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

self waittill / memory access out of bounds #3

Closed
kungfooman opened this issue Sep 15, 2019 · 2 comments
Closed

self waittill / memory access out of bounds #3

kungfooman opened this issue Sep 15, 2019 · 2 comments

Comments

@kungfooman
Copy link
Contributor

task()
{
    self waittill("begin counting");
    printf("self = %\n", self);
}

main()
{
    o = spawnstruct();
    o thread task();
    wait 1;
    o notify("begin counting");
    printf("notifying\n");
}

This script fails with:

image

@riicchhaarrd
Copy link
Owner

riicchhaarrd commented Sep 15, 2019

edit: fixed in riicchhaarrd/gsc@5bd954f

you can't call threads with assigned self yet from inside the script (self <builtin_func>() methods work and from exec_ent_thread assigns self) will be added on later aswell

fix for now is to just pass the object along with the arguments instead of self

task(o)
{
    o waittill("begin counting");
    printf("self = %\n", o);
}

main()
{
    o = spawnstruct();
    thread task(o);
    wait 1;
    o notify("begin counting");
    printf("notifying\n");
}

@riicchhaarrd riicchhaarrd pinned this issue Mar 20, 2021
@riicchhaarrd riicchhaarrd unpinned this issue Mar 20, 2021
@kungfooman
Copy link
Contributor Author

Apparently fixed by:

riicchhaarrd/gsc@5bd954f

riicchhaarrd/gsc@712daad

Screenshot from @riicchhaarrd on Discord:

kunggsc

Thank you so much for fixing! 🥇

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

2 participants