SHA-1: 8852bc7278d033bbed66c51bf23aee841ee977a9

* Revert "Modify CMPJMP to produce more compact code (as far as VC++ is concerned, anyway)"

This reverts commit 6ff973a06b.

This modification did not work and broke the comparisons. Actually this had three problems:

* the asserts checked the wrong instruction
* the mask was not applied to regular comparisons.
* incrementing PC before testing does not work because 'test' references the PC.
This commit is contained in:
Christoph Oelckers 2016-11-02 10:52:14 +01:00
commit ff8b216167
2 changed files with 27 additions and 33 deletions

View file

@ -82,17 +82,11 @@
#define THROW(x) throw(EVMAbortException(x))
#define CMPJMP(test) \
pc++; \
if (VM_UBYTE(test) == VM_UBYTE(a)) { \
if ((test) == (a & CMP_CHECK)) { \
assert(pc[1].op == OP_JMP); \
pc += JMPOFS(pc); \
}
#define CMPJMP_MASK(test) \
pc++; \
if (VM_UBYTE(test) == (VM_UBYTE(a) & CMP_CHECK)) { \
assert(pc[1].op == OP_JMP); \
pc += JMPOFS(pc); \
pc += 1 + JMPOFS(pc+1); \
} else { \
pc += 1; \
}
#define GETADDR(a,o,x) \