-
Notifications
You must be signed in to change notification settings - Fork 472
Fix for #796 (CA65: References inside of a scope aren't known outside of that scope.) #1072
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
base: master
Are you sure you want to change the base?
Conversation
|
@laubzega: Please explain the status of this PR from your POV. |
|
@oliverschmidt: Experimental code. May have to be scrapped in entirety or in part, depending on the evaluation by @vrubleg. Currently waiting for feedback. |
|
Sorry that I'm so late. I tested this code on one of my projects. In most cases it works fine, except such situation: It is expected that I would provide FASMG as an example of an assembler where such tricks work without issues (but it is a multi-pass assembler). For example, this code shows the same situation, and it works as expected ( |
|
mmh. the given example seems plausible to me - but i cant judge if that fix makes sense or what else it could break @kugelfuhr comment? :) |
|
I haven't exactly analyzed what the code changes do, but they are surprisingly simple for what they claim to do. And indeed a simple test shows serious problems. Using this input which contains a forward reference inside a the assembler prints But with this patch, we get: This means that the patch causes the assembler to somehow think that there's a symbol The whole reason for the problems with local scopes comes from the fact that any symbol used within a local scope may be a forward reference to a symbol in this or an embedded scope. Like I don't know if it is possible to fix the PR. My gut feeling says that it needs more than a few lines of code changes. |
|
Sound like the proposed fix is too simple. So converting this to draft as well |
|
It requires a significant refactoring to make it working in all cases, it looks like it will require to make assembler multipass (like FASMG). |
No description provided.