This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] Fix PR21580 - Undefined behavior in readEncodedPointer()
ClosedPublic

Authored by EricWF on Mar 9 2015, 1:26 PM.

Diff Detail

Event Timeline

EricWF updated this revision to Diff 21507.Mar 9 2015, 1:26 PM
EricWF retitled this revision from to [libcxx] Fix PR21580 - Undefined behavior in readEncodedPointer().
EricWF updated this object.
EricWF edited the test plan for this revision. (Show Details)
EricWF added a subscriber: Unknown Object (MLST).
compnerd edited edge metadata.Mar 9 2015, 6:31 PM

I imagine that you couldn't give a bit more context on what platform/environment you managed to get the unaligned read for future reference. We should get the change in irrespective of that.

src/cxa_personality.cpp
145

Any reason to have this in the __cxxabiv1::(anonymous namespace) rather than (anonymous namespace)? Maybe mark the function static and ignore the namespacing as the trend in the rest of LLVM has been?

148

FromType is poorly chosen I think. AsType might be better. The data is being read from a uint8_t *, but being read as the type specified.

151

Please use the appropriate new (C++) style cast here.

EricWF updated this revision to Diff 21541.Mar 9 2015, 6:43 PM
EricWF edited edge metadata.

Address @compnerd's comments.

compnerd accepted this revision.Mar 9 2015, 6:49 PM
compnerd edited edge metadata.
This revision is now accepted and ready to land.Mar 9 2015, 6:49 PM
mclow.lists accepted this revision.Mar 10 2015, 8:41 AM
mclow.lists edited edge metadata.
EricWF closed this revision.Mar 10 2015, 1:46 PM