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

Fix mismatched external parser with binary exports #93166

Conversation

Hilderin
Copy link
Contributor

@Hilderin Hilderin commented Jun 14, 2024

The problem was caused by the reload method that was recreating a new parser for a base class even if the source was the same. The hash used was not based on the binary tokens but always on the text source. That’s why the problem was only on binary exports.

I adjusted to calculate the hash on binary tokens when present. I was wondering if we should skip this hash calculation and this check for binary exports since it’s probably not possible to change the binary at runtime?

Having 2 instances of the same parser/class was causing problem in has_class because the comparison is done on pointers only.

Example of the problem:
image

To reproduce the problem, I used the MRP from #92021 (https://github.com/godotengine/godot/files/15337905/reprobug.zip)
I exported the pck.
And I ran godot in debug with --main-pack test.pck

There is the test.pck I used if you want to test it without having to reexport the project:
test.pck.zip

@dalexeev
Copy link
Member

CC @rune-scape

Copy link
Contributor

@rune-scape rune-scape left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wonderful! ive been searching for this bug

@akien-mga akien-mga merged commit 70a0bee into godotengine:master Jun 17, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment