From 5c286dceb02207f72f97b1f9e792746bb7e22fb3 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 19 Mar 2017 21:36:18 +0100 Subject: [PATCH] - fixed: FxAssign used the wrong value type for emitting the store operation. It used the expression's value type, but needs to use the variable's, which can be different when the assignment is synthesized from a builtin function. # Conflicts: # src/scripting/backend/vmbuilder.cpp --- src/scripting/backend/codegen.cpp | 2 +- src/scripting/backend/vmbuilder.cpp | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/scripting/backend/codegen.cpp b/src/scripting/backend/codegen.cpp index 0ea6517da18..dcb978e9156 100644 --- a/src/scripting/backend/codegen.cpp +++ b/src/scripting/backend/codegen.cpp @@ -2514,7 +2514,7 @@ ExpEmit FxAssign::Emit(VMFunctionBuilder *build) if (IsBitWrite == -1) { - build->Emit(ValueType->GetStoreOp(), pointer.RegNum, result.RegNum, build->GetConstantInt(0)); + build->Emit(Base->ValueType->GetStoreOp(), pointer.RegNum, result.RegNum, build->GetConstantInt(0)); } else { diff --git a/src/scripting/backend/vmbuilder.cpp b/src/scripting/backend/vmbuilder.cpp index 308410922f8..4ed4f5c4e43 100644 --- a/src/scripting/backend/vmbuilder.cpp +++ b/src/scripting/backend/vmbuilder.cpp @@ -570,7 +570,6 @@ size_t VMFunctionBuilder::Emit(int opcode, int opa, int opb, int opc) assert(opb >= 0); assert(opc >= 0); - // The following were just asserts, meaning this would silently create broken code if there was an overflow // if this happened in a release build. Not good. // These are critical errors that need to be reported to the user.