Skip to content

sea: don't set code cache flags when snapshot is used

When both useCodeCache and useSnapshot are set, we generate the snapshot and skip the generation of the code cache since the snapshot already includes the code cache. But we previously still persist the code cache setting in the flags that got serialized into the SEA, so the resulting executable would still try to read the code cache even if it's not added to the SEA, leading to a flaky crash caused by OOB on some platforms.

This patch fixes the crash by ignoring the code cache setting when generating the flag if both snapshot and code cache is configured.

Fixes: https://github.com/nodejs/node/issues/50740

Merge request reports

Loading