Fixed missing type info in object register when returning from sys call#24
Open
bluecataudio wants to merge 3 commits intoBlindMindStudios:masterfrom
Open
Fixed missing type info in object register when returning from sys call#24bluecataudio wants to merge 3 commits intoBlindMindStudios:masterfrom
bluecataudio wants to merge 3 commits intoBlindMindStudios:masterfrom
Conversation
When calling a function that returns a reference or handle thru a system call, the objectType field is not set. So if the function that is called suspends execution, the state of the VM is incomplete (objectType is garabe). This leads to a crash if the context is cleaned up, unless execution is continued.
Author
|
The fix has now also been validated on Mac (XCode4 and XCode7, 10.7 SDK). |
- removed asBC_STR instruction support (deprecated in angelscript 2.32) - fixed crash when compiling copy instructions for objects without addref/release defined
Author
|
Added new fixes for Angelscript 2.33.0 compatibility |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
I have found a bug in the JIT that crashes the VM when a native function exposed to the scripts both returns a reference or handle value and suspends the execution of the VM: if the execution is not continued before releasing the context, the VM crashes, because the object type register is set random memory.
This is because the JIT does not set the object type during a system call (it only sets the objectRegister). It probably works in standard scenarios because the asBC_STOREOBJ instruction is called right after, but if execution is suspended during the system call, the VM is in an unstable state.
Here is a proposal to fix this issue, simply setting the objectType pointer together with the objectRegister. Tested on Windows only so far, but it is probably not impacting other platforms either.