https://bugs.kde.org/show_bug.cgi?id=497861

            Bug ID: 497861
           Summary: ARM: SUBW Rd, Rn, #uimm12 should accept SP as Rn
    Classification: Developer tools
           Product: valgrind
           Version: 3.24 GIT
          Platform: unspecified
                OS: Other
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: vex
          Assignee: jsew...@acm.org
          Reporter: aoikonomopou...@igalia.com
  Target Milestone: ---

Created attachment 176865
  --> https://bugs.kde.org/attachment.cgi?id=176865&action=edit
A trivial fix.

SUMMARY
The ARM manual specifies
(https://developer.arm.com/documentation/dui0489/i/arm-and-thumb-instructions/sub)
that SUBW Rd, Rn, #uimm12 accepts SP as Rn. However, the (T4) SUBW Rd, Rn,
#uimm12 case in guest_arm_toIR.c only accepts this form when SP is both Rd and
Rn.

STEPS TO REPRODUCE
1. Manually code up a program that uses such an instruction, e.g. I ran into
subw    r3, sp, #8 in WebKit's JavaScriptCore.
2. Run the program natively, observe that it doesn't hit a SIGILL.
3. Run the program under valgrind, observe that it takes a SIGILL.

OBSERVED RESULT

SIGILL.

EXPECTED RESULT

No SIGILL.

SOFTWARE/OS VERSIONS
Valgrind at commit 04edd792bd707bace8ccbf947b48b0c70b7dc5d0.

ADDITIONAL INFORMATION

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to