This patch fixes a bug in readEncodedPointer() where it would read from memory that was not suitably aligned. This patch fixes it by using memcpy.
Details
- Reviewers
mclow.lists danalbert compnerd echristo - Commits
- rG84bbfdced89e: Merging r231839: --------------------------------------------------------------…
rGe6cdf3411630: [libcxx] Fix PR21580 - Undefined behavior in readEncodedPointer()
rCXXA231839: [libcxx] Fix PR21580 - Undefined behavior in readEncodedPointer()
rL231839: [libcxx] Fix PR21580 - Undefined behavior in readEncodedPointer()
Diff Detail
Event Timeline
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. |
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?