Section 10.7 in Partition II of the ECMA 335 standard suggests that it's safe, but unverifiable:

"Offset values shall be non-negative. It is possible to overlap fields in this way, though offsets occupied by an
object reference shall not overlap with offsets occupied by a built-in value type or a part of another object
reference. While one object reference can completely overlap another, this is unverifiable."

How does your example fail on the marked lines? It doesn't for me. If you use such unverifiable code you normally can't rely on the JIT catching errors. (So it's probably a good idea to at least put some type-check asserts into your methods.)

By on 4/24/2010 7:15 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper