acl: fix undefined behavior of bit shifts
authorAaron Conole <aconole@redhat.com>
Wed, 31 Jul 2019 15:43:11 +0000 (11:43 -0400)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 2 Aug 2019 20:07:07 +0000 (22:07 +0200)
commit5924381221b022b589bef88bacea8a59a7bf6c8b
tree5d63efe6e26ce7988a96f8fbe106637ac7695b5c
parent786e0c74e69bba1e7915e839bd16773683965155
acl: fix undefined behavior of bit shifts

Left-shift of an integer constant is represented as 'int' type, but a left
shift of 1 by 31 bits in 'int' is undefined.  Use the U suffix to force
a representation as unsigned.

Caught while running with ubsan under gcc.

Fixes: dc276b5780c2 ("acl: new library")
Cc: stable@dpdk.org
Signed-off-by: Aaron Conole <aconole@redhat.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
lib/librte_acl/acl_bld.c
lib/librte_acl/acl_gen.c