aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/qregisters.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qregisters.cpp b/src/qregisters.cpp
index 615fc77..20f6e99 100644
--- a/src/qregisters.cpp
+++ b/src/qregisters.cpp
@@ -1058,10 +1058,10 @@ StateCopyToQReg::got_register(QRegister &reg)
tecoInt to = expressions.pop_num();
from = expressions.pop_num();
- if (!Validate::pos(from) || !Validate::pos(to))
- throw RangeError("X");
-
len = to - from;
+
+ if (len < 0 || !Validate::pos(from) || !Validate::pos(to))
+ throw RangeError("X");
}
tr.chrg.cpMin = from;