Skip to content

Commit 344636b

Browse files
committed
fix #317: the number of periods in a loop should be rounded
1 parent 52b41af commit 344636b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/engine/virtualmachine_p.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ unsigned int *VirtualMachinePrivate::run(unsigned int *pos, bool reset)
260260
DISPATCH();
261261

262262
do_repeat_loop:
263-
loopCount = READ_LAST_REG()->toLong();
263+
loopCount = std::round(READ_LAST_REG()->toDouble());
264264
FREE_REGS(1);
265265
if (loopCount <= 0) {
266266
loopEnd = pos;

0 commit comments

Comments
 (0)