Skip to content

Handle sbrk import by emscripten+upstream in SafeHeap#2332

Merged
kripken merged 2 commits intomasterfrom
fix3
Sep 6, 2019
Merged

Handle sbrk import by emscripten+upstream in SafeHeap#2332
kripken merged 2 commits intomasterfrom
fix3

Conversation

@kripken
Copy link
Copy Markdown
Member

@kripken kripken commented Sep 6, 2019

To allow #2331 to roll, I forgot that upstream and fastcomp handle sbrk differently. This fixes that, and handles the upstream case where we import sbrk itself from JS.

We can simplify this after emscripten-core/emscripten#9397 lands, however, it may also be nice to keep the backwards compatibility for running on existing wasm files in the wild.

@kripken kripken requested a review from tlively September 6, 2019 13:42
@kripken kripken changed the title fix Handle sbrk import by emscripten+upstream in SafeHeap Sep 6, 2019
@tlively
Copy link
Copy Markdown
Member

tlively commented Sep 6, 2019

I don’t quite understand why there are three(?) possible cases now, but the code LGTM.

@kripken
Copy link
Copy Markdown
Member Author

kripken commented Sep 6, 2019

The three cases handle old upstream (import sbrk), old fastcomp (import DYNAMICTOP_PTR) and new everything (import emscripten_get_sbrk_ptr).

@kripken
Copy link
Copy Markdown
Member Author

kripken commented Sep 6, 2019

Local testing shows this should unbreak the binaryen roll, merging.

@kripken kripken merged commit 849ea21 into master Sep 6, 2019
@kripken kripken deleted the fix3 branch September 6, 2019 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants