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

mapjson should error out on empty string fields. #1261

Closed
luckytyphlosion opened this issue Dec 3, 2020 · 1 comment · Fixed by #1847
Closed

mapjson should error out on empty string fields. #1261

luckytyphlosion opened this issue Dec 3, 2020 · 1 comment · Fixed by #1847

Comments

@luckytyphlosion
Copy link
Member

Currently, mapjson allows empty string fields, which is not a meaningful definition. If a field expects a string and is specified with an empty string, then the output *.inc file will simply have no data in the .Xbyte directive. GNU Assembler allows no expression to be specified within an .Xbyte directive (which will simply not insert any bytes), so the output *.inc file will be assembled without any error. As a result, all fields after the missing expression will be placed in incorrect struct offsets, and will most likely lead to in-game crashes.

There's more room for potential error checking (e.g. you can add commas in a string -> Xbyte field and it will result in multiple Xbytes being output), but inputting in empty strings is the most likely error to run into.

ghoulslash pushed a commit to ghoulslash/pokeemerald that referenced this issue Mar 28, 2021
@rawr51919
Copy link
Contributor

Sure seems like a weird bug, might be tough yet not impossible to fix

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.

2 participants