Fix adjusting jumps

This commit is contained in:
Ilmir Usmanov
2014-08-05 11:51:49 +04:00
parent fb86387675
commit 3b624be051
4 changed files with 101 additions and 4 deletions
+2 -2
View File
@@ -192,8 +192,8 @@ optimizer_adjust_jumps (OPCODE *first_opcode, OPCODE *last_opcode, int16_t value
20: is_false_jmp 21
21: assignment
*/
if (current_opcode->data.is_true_jmp.opcode <= opcode_to_counter (first_opcode)
&& current_opcode->data.is_false_jmp.opcode < opcode_to_counter (last_opcode) - value)
if (current_opcode->data.is_false_jmp.opcode >= opcode_to_counter (first_opcode)
&& current_opcode->data.is_false_jmp.opcode <= opcode_to_counter (last_opcode) - value)
{
current_opcode->data.is_false_jmp.opcode = (T_IDX) (current_opcode->data.is_false_jmp.opcode + value);
continue;
+1 -1
View File
@@ -315,7 +315,7 @@ pp_opcode (opcode_counter_t oc, OPCODE opcode, bool is_rewrite)
uint8_t i = 1;
uint8_t opcode_num = opcode.op_idx;
__printf ("%03d: %20s ", oc++, opcode_names[opcode_num]);
__printf ("%03d: %20s ", oc, opcode_names[opcode_num]);
if (opcode_num != NAME_TO_ID (nop) && opcode_num != NAME_TO_ID (ret)
&& opcode_num != NAME_TO_ID (end_with))
{