Quantcast
Channel: Common Language Runtime Internals and Architecture forum
Viewing all articles
Browse latest Browse all 1710

ECMA-335 forbids null as a managed pointer, but ECMA-372 allows nullptr as an interior pointer

$
0
0

Related to the how can a function return an lvalue thread, there seems to be an inconsistency between ECMA-335 and ECMA-372:

  • In ECMA-335 (Common Language Infrastructure (CLI)), 6th Edition, §II.14.4.2 (Managed Pointers) says: "Managed pointers cannot be null, and they shall be reported to the garbage collector even if they do not point to managed memory."
  • In ECMA-335, §III.1.1 (Data types) says: "Pointer types (native unsigned int and &) […] Note that object references and pointer types can be assigned the value null."
  • In ECMA-335, §III.1.1.5.2 (Managed pointers (type &)) says: "Managed pointers cannot be null."
  • In ECMA-372 (C++/CLI Language Specification), 1st Edition, §12.3.6.1 (Definitions) says: "The default initial value for an interior pointer shall be nullptr."
  • In ECMA-372, §34.2.2 (Interior pointers) says: "An interior pointer to a type shall be emitted into metadata as a managed pointer to that type with the modopt IsExplicitlyDereferenced (§33.1.5.4)."

The value of an interior pointer defaults to nullptr, but it is emitted as a managed pointer, which cannot be null – or can it?

Does this just mean that an implementation of ECMA-335 does not have to support null managed pointers, but if it implements ECMA-372 as well, then it has to support them?

Is there a list of errata for these standards?



Viewing all articles
Browse latest Browse all 1710

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>