Skip to content

Commit

Permalink
Don't change flags if shift count is zero
Browse files Browse the repository at this point in the history
  • Loading branch information
tbodt committed May 25, 2018
1 parent 18bac9a commit 130e966
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions emu/gadgets-x86/bits.S
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,20 @@
.macro do_shift type, size
.irp arg, reg_c,imm
.gadget \type\size\()_\arg
.ifc \arg,reg_c
\type\()l %cl, %_tmp
.else; .ifc \arg,imm
.ifc \arg,imm
pushq %rcx
movb (%_ip), %cl
\type\()l %cl, %_tmp
popq %rcx
.endif; .endif
.endif
testb %cl, %cl
jz 1f
\type\()l %cl, %_tmp
setf_oc
setf_zsp %_tmp, l
clearf_a
1:
.ifc \arg,imm
popq %rcx
.endif
.ifc \arg,imm
gret 1
.else
Expand Down

0 comments on commit 130e966

Please sign in to comment.