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

Server panic when setting nested value in a property with a waif's :_set_index #87

Open
Oliver2213 opened this issue May 27, 2024 · 0 comments

Comments

@Oliver2213
Copy link

Oliver2213 commented May 27, 2024

The server panics when trying to use _index and _set_index to store a nested value in a waif stored in a property. Interestingly, it seems to work properly for variables, or at least if not properly it doesn't crash.
Put differently: if you store a waif in a property that has these two verbs, and you try to add a key to any submap of that waif, server panic.
Here's an example object, using $waif as its parent; call crash() on it to reproduce the bug:

@create $waif named Crash The Server Waif
@prop #710.":data" [] rc
@prop #710."crash" 0
@verb #710:":_index" this none this
@program #710::_index
return this.data[args[1]];
.

@verb #710:":_set_index" this none this
@program #710::_set_index
this.data[args[1]] = args[2];
return this;
.

@verb #710:"crash" this none this
@program #710:crash
w = this:new();
this.crash = w;
this.crash["data"] = "something";
"Good so far.";
this.crash["submap"] = [];
"Even here. But then...";
this.crash["submap"]["anything"] = 1;
"panic";
.
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

No branches or pull requests

1 participant