Skip to content

Conversation

nielsdos
Copy link
Member

@nielsdos nielsdos commented Jun 1, 2024

Use the same stack limit check already used elsewhere in compilation.

… of error

Use the same stack limit check already used elsewhere in compilation.
@nielsdos
Copy link
Member Author

nielsdos commented Jun 2, 2024

I think this needs a different solution, I think we should return a success/failure status from zend_build_cfg depending on the used stack space and then bail out of zend_jit_build_cfg like we already do if there are too many blocks:

/* Don't JIT huge functions. Apart from likely being detrimental due to the amount of
* generated code, some of our analysis is recursive and will stack overflow with many
* blocks. */
if (cfg->blocks_count > 100000) {
return FAILURE;
}

EDIT: I tried that here: #14432

@nielsdos nielsdos closed this Jun 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deep recursion in zend_cfg.c causes segfault instead of error

1 participant