This introduces three macros, to be used in place of a simple pointer assignment...
commit4c0b47d580c39a9d70d5df9e399f4957bcfef918
author"Andi McClure ext:(%22) <andi.mcclure@xamarin.com>
Tue, 27 Oct 2015 15:41:41 +0000 (27 11:41 -0400)
committer"Andi McClure ext:(%22) <andi.mcclure@xamarin.com>
Tue, 27 Oct 2015 15:41:41 +0000 (27 11:41 -0400)
treee7816c0922f7051bb5b22a1b0531ed159d97e2a7
parentb5ec396a79b62ef2f58f2815a50962f4ea072f59
This introduces three macros, to be used in place of a simple pointer assignment when working with images or imagesets:

CHECKED_METADATA_WRITE_PTR - Use this to assign a pointer when it points from memory hosted by an image or imageset to another.
CHECKED_METADATA_WRITE_PTR_LOCAL - Use this to assign a pointer when it points from memory noted by an image or imageset to itself.
CHECKED_METADATA_WRITE_PTR_EXEMPT - Use this to assign a pointer in memory hosted by an image or imageset, but which the audit feature cannot correctly check at this time (this is the case when an image must contain a pointer to something that is not located in a mempool, such as a constant string). This is so that at least we know where these exceptions to the audits are.

In non-checked mode, each of these is a simple assignment. In checked mode, they walk the graph of references between images to make sure invariants related to ref_count are not violated.
mono/metadata/Makefile.am
mono/metadata/image-internals.h [new file with mode: 0644]
mono/metadata/image.c
mono/utils/checked-build.c
mono/utils/checked-build.h