Skip to content

Commit

Permalink
fix issue with non-deterministic bytecode generation
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitalita committed Dec 28, 2024
1 parent 6ff72d5 commit 7543693
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions bytecode/bytecode_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1679,7 +1679,7 @@ Vector<uint8_t> GDScriptDecomp::compile_code_string(const String &p_code) {
Error err = VariantDecoderCompat::encode_variant_compat(get_variant_ver_major(), E->get(), nullptr, len, encode_full_objects);
GDSDECOMP_FAIL_COND_V_MSG(err != OK, Vector<uint8_t>(), "Error when trying to encode Variant.");
int pos = buf.size();
buf.resize(pos + len);
buf.resize_zeroed(pos + len);
VariantDecoderCompat::encode_variant_compat(get_variant_ver_major(), E->get(), &buf.write[pos], len, encode_full_objects);
}

Expand Down Expand Up @@ -1877,7 +1877,6 @@ Error GDScriptDecomp::test_bytecode_match(const Vector<uint8_t> &p_buffer1, cons
return ERR_BUG;
}
if (state1.bytecode_version < GDSCRIPT_2_0_VERSION) {
err = ERR_BUG;
discontinuity = continuity_tester(p_buffer1, p_buffer2, "Bytecode");
} else {
auto decompressed_size1 = decode_uint32(&p_buffer1[8]);
Expand All @@ -1893,7 +1892,6 @@ Error GDScriptDecomp::test_bytecode_match(const Vector<uint8_t> &p_buffer1, cons
if (discontinuity == -1) {
return OK;
}
err = ERR_BUG;
}

Ref<GDScriptDecomp> decomp = create_decomp_for_commit(get_bytecode_rev());
Expand Down

0 comments on commit 7543693

Please sign in to comment.