ubsan: bpf: left shift cannot be represented in type 'DI' (aka 'long')

Message ID 20191217060757.GO32672@bubble.grove.modra.org
State New
Headers show
Series
  • ubsan: bpf: left shift cannot be represented in type 'DI' (aka 'long')
Related show

Commit Message

Alan Modra Dec. 17, 2019, 6:07 a.m.
cpu/
	* bpf.cpu (f-imm64): Avoid signed overflow.
opcodes/
	* bpf-ibld.c: Regenerate.


-- 
Alan Modra
Australia Development Lab, IBM

Patch

diff --git a/cpu/bpf.cpu b/cpu/bpf.cpu
index db2301c495..d5a8eacc05 100644
--- a/cpu/bpf.cpu
+++ b/cpu/bpf.cpu
@@ -288,8 +288,8 @@ 
                     (set (ifield f-imm64-a) (and (ifield f-imm64) (const #xffffffff)))))
   (extract (sequence ()
                      (set (ifield f-imm64)
-                          (or (sll DI (zext DI (ifield f-imm64-c)) (const 32))
-                              (zext DI (ifield f-imm64-a)))))))
+                          (or (sll UDI (zext UDI (ifield f-imm64-c)) (const 32))
+                              (zext UDI (ifield f-imm64-a)))))))
 
 ;;; Operands