Skip to content

Commit b2cd65e

Browse files
committed
Revert "Fix crash in LLVM exception handler on macOS Big Sur"
This reverts commit 597ca77.
1 parent 6e49b4a commit b2cd65e

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

substratevm/src/com.oracle.svm.core.graal.llvm/src/com/oracle/svm/core/graal/llvm/runtime/LLVMExceptionUnwind.java

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
import org.graalvm.nativeimage.c.function.CFunction;
3939
import org.graalvm.nativeimage.c.struct.CField;
4040
import org.graalvm.nativeimage.c.struct.CStruct;
41-
import org.graalvm.nativeimage.c.struct.SizeOf;
4241
import org.graalvm.word.Pointer;
4342
import org.graalvm.word.PointerBase;
4443
import org.graalvm.word.WordFactory;
@@ -145,19 +144,7 @@ public static ExceptionUnwind createRaiseExceptionHandler() {
145144
return new ExceptionUnwind() {
146145
@Override
147146
protected void customUnwindException(Pointer callerSP) {
148-
int size = SizeOf.get(_Unwind_Exception.class);
149-
// Alloc more space for extra alignment
150-
size += 16;
151-
152-
_Unwind_Exception exceptionStructure = StackValue.get(size);
153-
154-
// Get the raw address of the pointer
155-
long addr = exceptionStructure.rawValue();
156-
// Make sure the addr is aligned to at least 16 bytes
157-
addr = (addr + 15L) & ~(15L);
158-
// Convert back
159-
exceptionStructure = WordFactory.pointer(addr);
160-
147+
_Unwind_Exception exceptionStructure = StackValue.get(_Unwind_Exception.class);
161148
exceptionStructure.set_exception_class(CurrentIsolate.getCurrentThread());
162149
exceptionStructure.set_exception_cleanup(WordFactory.nullPointer());
163150
raiseException(exceptionStructure);

0 commit comments

Comments
 (0)