diff --git a/addons/cert.py b/addons/cert.py index fb223f435..a4f8c507f 100755 --- a/addons/cert.py +++ b/addons/cert.py @@ -195,7 +195,9 @@ def int31(data, platform): if to_value_type is None or not from_values: continue bits = None - if to_value_type.type == 'char': + if token.valueType.pointer > 0: + bits = platform.pointer_bit + elif to_value_type.type == 'char': bits = platform.char_bit elif to_value_type.type == 'short': bits = platform.short_bit diff --git a/addons/test/cert-test.c b/addons/test/cert-test.c index 15a3e7237..a4a4dd2da 100644 --- a/addons/test/cert-test.c +++ b/addons/test/cert-test.c @@ -82,6 +82,11 @@ void int31(int x) unsigned char c; c = 256; c = -1; + + // issue #10782 + uint16_t * ptr; + uint32_t var = 65536; + ptr = (uint16_t *)var; } void env33()