Skip to content

webidl_binder.py contains unguarded asserts #21198

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

Open
VirtualTim opened this issue Jan 29, 2024 · 2 comments
Open

webidl_binder.py contains unguarded asserts #21198

VirtualTim opened this issue Jan 29, 2024 · 2 comments

Comments

@VirtualTim
Copy link
Collaborator

As of Emscripten 3.1.48:

The JS assert function is no longer available in release builds when -sSTRICT is used. This should only affect users with custom JS library code which doesn't use #if ASSERTIONS guards around their assert calls.

webidl_binder.py contains several asserts which aren't guarded. Incomplete list:

assert(ensureCache.buffer);

assert(ensureCache.buffer);

assert(len > 0); // null terminator, at least

@sbc100
Copy link
Collaborator

sbc100 commented Jan 29, 2024

I believe this is a dup of #20592 which has a fix in flight in #21171

VirtualTim added a commit that referenced this issue Jan 29, 2024
Surround asserts in a CHECKS == 'ALL' conditional, similar to other asserts.

Allows a workaround to #21198, when a user builds with: export IDL_CHECKS="FAST"
@VirtualTim
Copy link
Collaborator Author

@sbc100 Ah I didn't see that, and added a PR of my own.
Not sure which approach is better, but I like that you're will catch any more asserts added in the future.

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

No branches or pull requests

2 participants