[PATCH] D107784: Fix SEH table addresses for Windows

Daniel Paoliello via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 10 13:07:02 PDT 2021


dpaoliello marked 4 inline comments as done.
dpaoliello added inline comments.


================
Comment at: llvm/test/CodeGen/WinEH/wineh-noret-cleanup.ll:49
 ; CXX-NEXT:   .long   -1
-; CXX-NEXT:   .long   .Ltmp0 at IMGREL+1
+; CXX-NEXT:   .long   .Ltmp0 at IMGREL
 ; CXX-NEXT:   .long   1
----------------
rnk wrote:
> These changes are incorrect. The C++ ip2state table doesn't have a begin/end pair, it has a series of labels. When an exception is thrown from the last instruction in a range, these labels must be strictly greater than the return address.
> 
> Fortunately, there are no single-byte instructions that can throw a C++ exception, so the entire table can be biased forwards by one byte.
Ah, ok, this makes sense:
In all of the caller frames we need to consider the calling instruction, not the instruction that we will be returning to.
For the throwing frame itself, we're off by 1, however the address of the throwing instruction is always less than the next IP2State transition since there is no one byte throwing instruction.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107784/new/

https://reviews.llvm.org/D107784



More information about the llvm-commits mailing list