Skip to content

Commit

Permalink
Merge pull request #93166 from Hilderin/fix-binary-export-mismatched-…
Browse files Browse the repository at this point in the history
…external-parser

Fix mismatched external parser with binary exports
  • Loading branch information
akien-mga committed Jun 17, 2024
2 parents 0347130 + c419b54 commit 70a0bee
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions modules/gdscript/gdscript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -771,8 +771,16 @@ Error GDScript::reload(bool p_keep_state) {
if (GDScriptCache::has_parser(source_path)) {
Error err = OK;
Ref<GDScriptParserRef> parser_ref = GDScriptCache::get_parser(source_path, GDScriptParserRef::EMPTY, err);
if (parser_ref.is_valid() && parser_ref->get_source_hash() != source.hash()) {
GDScriptCache::remove_parser(source_path);
if (parser_ref.is_valid()) {
uint32_t source_hash;
if (!binary_tokens.is_empty()) {
source_hash = hash_djb2_buffer(binary_tokens.ptr(), binary_tokens.size());
} else {
source_hash = source.hash();
}
if (parser_ref->get_source_hash() != source_hash) {
GDScriptCache::remove_parser(source_path);
}
}
}
}
Expand Down

0 comments on commit 70a0bee

Please sign in to comment.