File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -312,7 +312,10 @@ class X64Visitor : public WASMDecoder<X64Visitor>,
312
312
handleI32Opt ([&](){ m_a.asm_mul_r64 (X64Reg::rbx);});
313
313
}
314
314
void visit_I32DivS () {
315
- handleI32Opt ([&](){ m_a.asm_div_r64 (X64Reg::rbx);});
315
+ handleI32Opt ([&](){
316
+ m_a.asm_mov_r64_imm64 (X64Reg::rdx, 0 );
317
+ m_a.asm_div_r64 (X64Reg::rbx);
318
+ });
316
319
}
317
320
318
321
void visit_I32And () {
@@ -397,7 +400,9 @@ class X64Visitor : public WASMDecoder<X64Visitor>,
397
400
handleI64Opt ([&](){ m_a.asm_mul_r64 (X64Reg::rbx);});
398
401
}
399
402
void visit_I64DivS () {
400
- handleI64Opt ([&](){ m_a.asm_div_r64 (X64Reg::rbx);});
403
+ handleI64Opt ([&](){
404
+ m_a.asm_mov_r64_imm64 (X64Reg::rdx, 0 );
405
+ m_a.asm_div_r64 (X64Reg::rbx);});
401
406
}
402
407
403
408
void visit_I64And () {
@@ -415,6 +420,7 @@ class X64Visitor : public WASMDecoder<X64Visitor>,
415
420
void visit_I64RemS () {
416
421
m_a.asm_pop_r64 (X64Reg::rbx);
417
422
m_a.asm_pop_r64 (X64Reg::rax);
423
+ m_a.asm_mov_r64_imm64 (X64Reg::rdx, 0 );
418
424
m_a.asm_div_r64 (X64Reg::rbx);
419
425
m_a.asm_push_r64 (X64Reg::rdx);
420
426
}
You can’t perform that action at this time.
0 commit comments