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

Module api bugs #6992

Merged
merged 2 commits into from May 16, 2024
Merged

Module api bugs #6992

merged 2 commits into from May 16, 2024

Conversation

rhuanjl
Copy link
Collaborator

@rhuanjl rhuanjl commented May 2, 2024

These two small bugs have been knocking around for a while; both relate to incorrect/unintended use of the hosting APIs but they both can lead to nullptr de-refs rather than returning error codes as an embedder should expect.

  1. When a module was imported from a script triggerring the fetchImportedModuleFromScriptCallback, CC was incorrectly checking if the fetchImportedModuledCallback was set but not checking the callback it was actually going to use. (I did a minor refactor fixing this, eliminating a helper method as whilst this meant some small code duplication it was a net 0 change to total lines of code, gained lines are fix number 2 and copyright changes)
  2. When GetModuleNumespace was invked on a module marked as evaluated BUT having a syntax error, CC was performing a nullptr de-ref rather than returning an error code.

FYI @fatcerberus

Fix: #5880
Fix: #6788

@rhuanjl rhuanjl merged commit 682026b into chakra-core:master May 16, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants