[Scummvm-cvs-logs] scummvm master -> 840178a9071971a816c0fa184e262dfff379fa07
bluegr
md5 at scummvm.org
Wed Mar 2 15:34:42 CET 2011
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
840178a907 SCI: Bug fixes to the reg_t addition operator
Commit: 840178a9071971a816c0fa184e262dfff379fa07
https://github.com/scummvm/scummvm/commit/840178a9071971a816c0fa184e262dfff379fa07
Author: md5 (md5 at scummvm.org)
Date: 2011-03-02T06:33:12-08:00
Commit Message:
SCI: Bug fixes to the reg_t addition operator
Thanks to fingolfin's comments regarding these
Changed paths:
engines/sci/engine/vm_types.cpp
diff --git a/engines/sci/engine/vm_types.cpp b/engines/sci/engine/vm_types.cpp
index dea4d63..0fc8144 100644
--- a/engines/sci/engine/vm_types.cpp
+++ b/engines/sci/engine/vm_types.cpp
@@ -46,7 +46,7 @@ reg_t reg_t::lookForWorkaround(const reg_t right) const {
}
reg_t reg_t::operator+(const reg_t right) const {
- if (isPointer() && isInitialized()) {
+ if (isPointer()) {
// Pointer arithmetics. Only some pointer types make sense here
SegmentObj *mobj = g_sci->getEngineState()->_segMan->getSegmentObj(segment);
@@ -59,13 +59,13 @@ reg_t reg_t::operator+(const reg_t right) const {
case SEG_TYPE_STACK:
case SEG_TYPE_DYNMEM:
// Make sure that we are adding an offset to the pointer
- if (right.isPointer())
+ if (!right.isNumber())
return lookForWorkaround(right);
return make_reg(segment, offset + right.toSint16());
default:
return lookForWorkaround(right);
}
- } else if (isNumber() && isInitialized() && right.isPointer()) {
+ } else if (isNumber() && right.isPointer()) {
// Adding a pointer to a number, flip the order
return right + *this;
} else {
More information about the Scummvm-git-logs
mailing list