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

Incorrect file name in errors when using .import #160

Open
athas opened this issue Sep 23, 2022 · 0 comments · May be fixed by #161
Open

Incorrect file name in errors when using .import #160

athas opened this issue Sep 23, 2022 · 0 comments · May be fixed by #161

Comments

@athas
Copy link

athas commented Sep 23, 2022

Suppose foo.s:

j bar

.include "bar.s"

And bar.s:

bar:    lw zero, 0(zero)

Then if you run java -jar rars.jar foo.s you will get an error reading:

Error in /home/athas/code/foo.s line 1: Runtime exception at 0x00400004: address out of range 0x00000000

But actually the error is in bar.s! The line number is correct, though.

athas added a commit to diku-dk/rars that referenced this issue Sep 23, 2022
This means that ProgramStatements now refer to the file they actually
occur in, like is the case for the original SourceLine.  This is used
for various diagnostics messages.

Fixes TheThirdOne#160.
@athas athas linked a pull request Sep 23, 2022 that will close this issue
athas added a commit to diku-dk/rars that referenced this issue Sep 23, 2022
The sourceProgram is not correct for statements that come from an
.include, and the assembler depends on the sourceProgram actually
being the "top-level" program, not the actual file.

Fixes TheThirdOne#160.
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 a pull request may close this issue.

1 participant