Skip to content

Commit

Permalink
extensibility shall not change the type from wide to narrow
Browse files Browse the repository at this point in the history
  • Loading branch information
vlm committed Feb 10, 2014
1 parent 58b74eb commit e5086e3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libasn1compiler/asn1c_constraint.c
Expand Up @@ -705,7 +705,7 @@ native_long_sign(asn1cnst_range_t *r) {
&& r->left.value >= 0
&& r->right.type == ARE_VALUE
&& r->right.value > 2147483647
&& (unsigned long)r->right.value <= 4294967295UL) {
&& r->right.value <= 4294967295UL) {
if(r->el_count == 0
&& r->left.value == 0
&& r->right.value == 4294967295UL)
Expand Down
8 changes: 6 additions & 2 deletions libasn1compiler/asn1c_misc.c
Expand Up @@ -359,9 +359,13 @@ asn1c_type_fits_long(arg_t *arg, asn1p_expr_t *expr) {
*/
range = asn1constraint_compute_PER_range(expr->expr_type,
expr->combined_constraints, ACT_EL_RANGE, 0, 0, 0);

if(!range
/* Commenting out
|| range->extensible
* because this may or may not indicate wide type.
*/
|| range->empty_constraint
|| range->extensible
|| range->incompatible
|| range->not_PER_visible
) {
Expand All @@ -379,7 +383,7 @@ asn1c_type_fits_long(arg_t *arg, asn1p_expr_t *expr) {
&& left.value >= 0
&& right.type == ARE_VALUE
&& right.value > 2147483647
&& (unsigned long)right.value <= 4294967295UL)
&& right.value <= 4294967295UL)
return FL_FITS_UNSIGN;


Expand Down

0 comments on commit e5086e3

Please sign in to comment.