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

Reference to a global expression defined in a .global module causes a segfault #4

Open
tueda opened this issue Oct 8, 2013 · 2 comments
Labels
bug Something isn't working

Comments

@tueda
Copy link
Collaborator

tueda commented Oct 8, 2013

The following program doesn't make any sense in practice (.global just saves declarations), but it causes a segmentation fault:

Global F = 1;
.global
Local G = F;
.end
@vermaseren
Copy link
Owner

Hi Takahiro,

What happens, I guess, is that the .global does not work out the first
expression. After the .global that one is kind of 'hanging' in the sense that
the subexpression subterm that refers to the 1 now refers to the subexpression
that contains the F and hence we get a circular reference.

I guess the proper thing would be that the .global does not clear the
compiler buffer. The alternative would be to also let it work as a .sort

What do you think better?

Cheers

Jos

Quoting Takahiro Ueda notifications@github.com:

The following program doesn't make any sense in practice (.global
just saves declarations), but it causes a segmentation fault:

Global F = 1;
.global
Local G = F;
.end

Reply to this email directly or view it on GitHub:
#4

@tueda
Copy link
Collaborator Author

tueda commented Oct 9, 2013

Hi Jos,

I guess the proper thing would be that the .global does not clear the compiler buffer. The alternative would be to also let it work as a .sort
What do you think better?

I think the former is fine if there is no side effect. Or maybe just printing an error or a warning would also be OK. It's a little thing and I guess no one will get in trouble about it except those who mistakenly use .global instead of .store like me :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants