]> Cypherpunks repositories - gostls13.git/commit
cmd/asm: restrict x86 shift ops to 8bit args
authorisharipo <iskander.sharipov@intel.com>
Thu, 7 Sep 2017 10:30:43 +0000 (13:30 +0300)
committerIlya Tocar <ilya.tocar@intel.com>
Thu, 7 Sep 2017 20:04:48 +0000 (20:04 +0000)
commit5b043abe1260d3ab0e5e27b6d312682149d321ba
tree3ca77ab11fbeb63bdef4d7e31c428b10c50ab0ad
parent9b8964bf2df0626530a0ca493e3e95d8dc3844dd
cmd/asm: restrict x86 shift ops to 8bit args

Change "yshl" and "yshb" immediate oclass from Yi32 to Yu8.
This forbids:
- negative shift counts
- shift counts that not fit into 8bit

Affects:
  RCL{B,L,Q,W}
  RCR{B,L,Q,W}
  ROL{B,L,Q,W}
  ROR{B,L,Q,W}
  SAL{B,L,Q,W}
  SAR{B,L,Q,W}
  SHL{B,L,Q,W}
  SHR{B,L,Q,W}

Issue #21528 has some additional context about this change.

Change-Id: I60884cb2b41a860820889fcd878ca6f564006b4a
Reviewed-on: https://go-review.googlesource.com/62190
Run-TryBot: Iskander Sharipov <iskander.sharipov@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/internal/obj/x86/asm6.go