Skip to content
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

Properly unlock identifiers when setting them #2183

Merged
merged 2 commits into from
Dec 1, 2017

Conversation

tsholmes
Copy link
Member

@tsholmes tsholmes commented Nov 29, 2017

Fixes #2182

The issue was that the changes in #2156 made it no longer visit the identifier node, which is where the auto-unlock code was.

Since this auto-unlock can only happen during a set, I moved the unlock code into ProcessSetOperation so it doesn't have to infer wether it needs to unlock based on the global state variables.

@Dunbaratu
Copy link
Member

This PR breaks SetSuffix.

Example:

set ship:name to "hello".

throws a nullref error.

The opcodes it generates are now just this:

interpreter             6:18  0070 @0050   push hello 
interpreter             6:18  0071 @0051   setmember <<--INSTRUCTION POINTER--

when they used to be like this:

interpreter             1:5   0022 @0002   push $ship 
interpreter             1:10  0023 @0003   push name 
interpreter             1:18  0024 @0004   push hello 
interpreter             1:18  0025 @0005   setmember 

The "push $ship" and "push name" steps are getting left out.

I realize this entire thing may become moot after you redesign setmember, so it may be smartest to just leave this PR out and just check that this issue is resolved with the new setmember code.

@Dunbaratu Dunbaratu merged commit 9c0884d into KSP-KOS:develop Dec 1, 2017
@Dunbaratu Dunbaratu added this to the v1.1.4.0 milestone Dec 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants