forked from ValveSoftware/source-sdk-2013
-
Notifications
You must be signed in to change notification settings - Fork 159
VScript member function call safety #436
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
Merged
Blixibon
merged 11 commits into
mapbase-source:develop
from
z33ky:vscript-member-function-call-safety
Jul 24, 2025
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
c851fc9
Ensure the squirrel instance for native member function call actually…
z33ky 681a75a
Check ScriptClassDesc_t of squirrel instance for native member functi…
z33ky 655679e
Check type of SQVector construction instance
z33ky ca7bc5d
Guard Squirrel constructor_stub() invocations from invalid class para…
z33ky 9c494b6
fxp streaml
z33ky 9c740a8
Check type of Squirrel constructor_stub() instance
z33ky 503fdd2
Fix SQVector member access check
z33ky be3ad93
Remove redundant typetag check from vscript_squirrel getVariant()
z33ky 9c38e4e
Remove redundant sq_resetobject() for SquirrelVM::lastError_
z33ky 3301edc
Guard get/set/tostring_stub() against illegal Squirrel instances
z33ky c659af5
Release SquirrelVM::lastError_ after pushing it to the VM stack
z33ky File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this still need a
sq_resetobject(&pSquirrelVM->lastError_);beforepClassDesc->m_pfnConstruct()? I don't seem to have issues without it though. I guesssq_release()also nulls the object?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not in here, we previously established that constructors don't raise script exceptions; it needs to be reset after returning it to the script on
function_stub(I guess I wasn't clear on that).sq_releasedoesn't nullify the input,RaiseExceptionresettinglastError_is irrelevantlastError_is a temporary object that is only meant to carry its state from withinm_pfnBinding()call tofunction_stub()body.This is the same logic of returning the result of
RegisterInstanceandHSCRIPT_RCif you recall that.