Skip to content

Commit

Permalink
C: fix compiler warning
Browse files Browse the repository at this point in the history
(cherry picked from commit 0e2052d)
  • Loading branch information
konsoletyper committed Oct 21, 2023
1 parent 10bd650 commit 699c26c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public boolean canHandle(MethodReference method) {
case "registerCallSite":
case "getExceptionHandlerId":
case "setExceptionHandlerId":
case "setExceptionHandlerSkip":
case "setExceptionHandlerRestore":
case "getStackTop":
case "getNextStackFrame":
case "getStackRootCount":
Expand Down Expand Up @@ -69,6 +71,12 @@ public void apply(IntrinsicContext context, InvocationExpr invocation) {
case "setExceptionHandlerId":
context.writer().print("TEAVM_SET_EXCEPTION_HANDLER");
break;
case "setExceptionHandlerSkip":
context.writer().print("TEAVM_SET_EXCEPTION_HANDLER_SKIP");
break;
case "setExceptionHandlerRestore":
context.writer().print("TEAVM_SET_EXCEPTION_HANDLER_RESTO");
break;
case "getStackTop":
context.writer().print("teavm_stackTop");
return;
Expand Down
2 changes: 2 additions & 0 deletions core/src/main/resources/org/teavm/backend/c/stack.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ typedef struct TeaVM_StackFrame {
#define TEAVM_WITH_CALL_SITE_ID(id, expr) (TEAVM_CALL_SITE(id), (expr))
#define TEAVM_EXCEPTION_HANDLER (teavm_shadowStack.header.callSiteId)
#define TEAVM_SET_EXCEPTION_HANDLER(frame, id) (((TeaVM_StackFrame*) (frame))->callSiteId = (id))
#define TEAVM_SET_EXCEPTION_HANDLER_SKIP(frame) (((TeaVM_StackFrame*) (frame))->callSiteId++)
#define TEAVM_SET_EXCEPTION_HANDLER_RESTORE(frame) (((TeaVM_StackFrame*) (frame))->callSiteId--)
#define TEAVM_GET_NEXT_FRAME(frame) (((TeaVM_StackFrame*) (frame))->next)
#define TEAVM_GET_CALL_SITE_ID(frame) (((TeaVM_StackFrame*) (frame))->callSiteId)

Expand Down

0 comments on commit 699c26c

Please sign in to comment.