This is an archive of the discontinued LLVM Phabricator instance.

[libunwind] Fix Unwind-EHABI.cpp:getByte on big-endian targets
ClosedPublic

Authored by miyuki on Jul 9 2019, 4:49 AM.

Diff Detail

Event Timeline

miyuki created this revision.Jul 9 2019, 4:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 9 2019, 4:49 AM
Herald added a subscriber: christof. · View Herald Transcript
ostannard requested changes to this revision.Jul 9 2019, 7:54 AM

This won't work for cross-unwinding between a big and little endian system, I think it would be better to load the whole word, and mask out the correct byte.

This revision now requires changes to proceed.Jul 9 2019, 7:54 AM
chill accepted this revision.Jul 9 2019, 7:54 AM
chill added a subscriber: chill.

LGTM, that's what EHABI spec says:

9.2 Exception-handling table entries
...
Unwinding instruction bytes are executed in order of significance within their containing word (most significant byte
first) and in increasing word address order. An implicit Finish instruction is assumed to be positioned after all the
explicitly present instructions.

chill added a comment.Jul 9 2019, 7:55 AM

Sorry, messages crossed.

ostannard accepted this revision.Jul 9 2019, 8:23 AM

Actually, I think cross-unwinding with EHABI is already completely broken, because we are doing raw memory accesses (not using the AddressSpace), so this is fine.

This revision is now accepted and ready to land.Jul 9 2019, 8:23 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJul 9 2019, 8:29 AM