PER visible constraints are used to select the native representation for INTEGER types
diff --git a/libasn1compiler/asn1c_constraint.c b/libasn1compiler/asn1c_constraint.c
index d75313d..372730f 100644
--- a/libasn1compiler/asn1c_constraint.c
+++ b/libasn1compiler/asn1c_constraint.c
@@ -62,6 +62,9 @@
switch(etype) {
case ASN_BASIC_INTEGER:
case ASN_BASIC_ENUMERATED:
+ if(asn1c_type_fits_long(arg, arg->expr) == FL_NOTFIT)
+ produce_st = 1;
+ break;
case ASN_BASIC_REAL:
if(!(arg->flags & A1C_USE_NATIVE_TYPES))
produce_st = 1;
@@ -556,7 +559,7 @@
switch(etype) {
case ASN_BASIC_INTEGER:
case ASN_BASIC_ENUMERATED:
- if(arg->flags & A1C_USE_NATIVE_TYPES) {
+ if(asn1c_type_fits_long(arg, arg->expr) != FL_NOTFIT) {
OUT("value = *(const long *)sptr;\n");
} else {
if(r_value->el_count == 0