Skip to content

GOT.func entry with no import/export: $emscripten_longjmp_jmpbuf #9950

Closed
WebAssembly/binaryen
#2513
@jeromelaban

Description

@jeromelaban

I'm re-opening an issue here regarding WebAssembly/binaryen#2180, where the 1.39.4 release does not fix the sample below. How does one validate that Binaryen has been updated since the original issue was fixed? Thanks!

#include <setjmp.h>
#include <stdio.h>

typedef struct {
  jmp_buf* jmp;
} jmp_state;

void setjmp_func(jmp_state* s, int level) {
  jmp_buf* prev_jmp = s->jmp;
  jmp_buf c_jmp;

  if (level == 2) {
    longjmp(*(s->jmp), 1);
  }

  if (setjmp(c_jmp) == 0) {
    setjmp_func(s, level + 1);
  }
}

int main() { return 0; }

Built as follows:

emcc \
   test.cpp \
   -o test.wasm \
   -s SIDE_MODULE=1

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions