OSDN Git Service

Subzero: Fix x86-64 memory sandboxing.
authorJim Stichnoth <stichnot@chromium.org>
Sat, 25 Jun 2016 17:01:24 +0000 (10:01 -0700)
committerJim Stichnoth <stichnot@chromium.org>
Sat, 25 Jun 2016 17:01:24 +0000 (10:01 -0700)
commitecbf2c4b314b07c7d4472be0a01b17c92007a9c7
treeb556a8c1c1f0266d52819e1545c02ac4ca939378
parent633394ce70a116f38a3cfdd03dc84bd2ce05a9ad
Subzero: Fix x86-64 memory sandboxing.

Commit 2e4b960 (https://codereview.chromium.org/2084793002), which made address mode inference more aggressive, exposed a long-standing bug in memory sandboxing, which now manifests in 164.gzip.

The problem is in sandboxed code like this:

  movl %eax, %eax
  movb 64(%rsp,%rax), %cl

If %eax starts out -1, the mov address is something close to %rsp+4GB, instead of %rsp+63.

To fix this, we need to use an lea instruction in more cases - specifically when the sandboxed address has an index register and the non-symbolic portion of the offset is nonzero.

BUG= none
R=jpp@chromium.org

Review URL: https://codereview.chromium.org/2097193003 .
src/IceTargetLoweringX8664.cpp