Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix STACKTOP/STACK_MAX variables for relocatable #8434

Merged
merged 2 commits into from
Apr 12, 2019

Conversation

rianhunter
Copy link
Contributor

STACKTOP and STACK_MAX were being output twice in relocatable modules. Fixes #8433

@kripken
Copy link
Member

kripken commented Apr 12, 2019

Looks good, thanks!

@kripken kripken merged commit e9c44b4 into emscripten-core:incoming Apr 12, 2019
@@ -484,7 +484,7 @@ def create_module_asmjs(function_table_sigs, metadata,
asm_runtime_thread_local_vars = create_asm_runtime_thread_local_vars()

stack = ''
if not (shared.Settings.WASM and shared.Settings.SIDE_MODULE):
if not shared.Settings.RELOCATABLE and not (shared.Settings.WASM and shared.Settings.SIDE_MODULE):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC this is redundant.

If we apply De Morgan's here I a little clearer to see:

if shared.Settings.RELOCATABLE or (shared.Settings.WASM and shared.Settings.SIDE_MODULE):

Since RELOCATABLE is always set for SIDE_MODULE the second clause is redundant I think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In theory, we may want to allow non-relocatable dynamic modules (i.e., loadable at runtime, but at known-beforehand locations in memory/table). At least it would be nice to not rule that out for now, I think. So checking for relocation separately makes sense in my opinion.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's how my original working diff was. I changed it to mirror the logic in the other part of the diff when I realized that other change was necessary.

VirtualTim pushed a commit to VirtualTim/emscripten that referenced this pull request May 21, 2019
VirtualTim added a commit to VirtualTim/emscripten that referenced this pull request May 23, 2019
VirtualTim added a commit to VirtualTim/emscripten that referenced this pull request May 23, 2019
belraquib pushed a commit to belraquib/emscripten that referenced this pull request Dec 23, 2020
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.

Incorrect STACKTOP in asm side modules
3 participants