Skip to content

Fix insertbin expression in ROM write statements#1

Open
PhoenixBound wants to merge 1 commit into
pk-hack:masterfrom
PhoenixBound:rom-insertbin
Open

Fix insertbin expression in ROM write statements#1
PhoenixBound wants to merge 1 commit into
pk-hack:masterfrom
PhoenixBound:rom-insertbin

Conversation

@PhoenixBound
Copy link
Copy Markdown

You can now put insertbin expressions inside of ROM[] and ROMTBL[] statements, as Mani Mani intended. It seems like the file field wasn't getting initialized properly after a new context was created inside those statements.

I ran the test suite on my non-Windows laptop and nothing broke. And I can't see any way that it could break, because some of the only other code that accesses EvalContext's file field (in IdentExpr) is commented out/useless. So, hopefully this fixes it.

ROM write statements didn't preserve the "file" name, which is what
InsertBinExpr uses to determine which paths to search for binary data.
When given a completely blank path for the current file, the binary
data would only be searched for in the parent of the working directory!

Pass along the file name when a new EvalContext is created.
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 this pull request may close these issues.

1 participant