[wip] Add missing SAVE_OPLINE() #10004
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a follow up to #9933 / #10003
SAVE_OPLINE() is used to save the register variable
opline
in EX(opline). It appears to have at least these purposes:zend_error() will crash if EX(opline) was not saved. zend_vm_def.h appears to consistenly save opline before anything that may trigger an error, but does not always account for the fact that memory allocations may trigger an error.
In this change I'm adding an assertion in emalloc functions to ensure that opline was saved, and a few missing SAVE_OPLINE() that the assertion helped to discover.
There is a remaining crash in jit_exit that I need to investigate. I also need to update zend_jit_arm64.dasc.