Skip to content

Commit

Permalink
- fixed: FxAssign used the wrong value type for emitting the store op…
Browse files Browse the repository at this point in the history
…eration.

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
  • Loading branch information
coelckers committed Mar 19, 2017
1 parent 244bb0f commit 5c286dc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion src/scripting/backend/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
1 change: 0 additions & 1 deletion src/scripting/backend/vmbuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 5c286dc

Please sign in to comment.