Browse Source

Fixed stack memory bug in VirtualMachine.

David Piuva 3 years ago
parent
commit
bb1b19dc4b
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Source/DFPSR/machine/VirtualMachine.cpp

+ 1 - 1
Source/DFPSR/machine/VirtualMachine.cpp

@@ -309,7 +309,7 @@ void VirtualMachine::addCallInstructions(const List<String>& arguments) {
 		int32_t newStackPointer[MAX_TYPE_COUNT] = {};
 		for (int t = 0; t < MAX_TYPE_COUNT; t++) {
 			newFramePointer[t] = memory.current.stackPointer[t];
-			newStackPointer[t] = memory.current.stackPointer[t] + machine.methods[oldMethodIndex].count[t];
+			newStackPointer[t] = memory.current.stackPointer[t] + machine.methods[calledMethodIndex].count[t];
 		}
 		// Assign inputs
 		for (int a = 1; a < args.length(); a++) {