From 58390334ebfd9819433e0a3f13237bdd5bd16bb5 Mon Sep 17 00:00:00 2001 From: Huang Hao Date: Thu, 7 Jul 2022 02:55:27 +0000 Subject: [PATCH] asn2wrs.py: fix Needs64b --- tools/asn2wrs.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/asn2wrs.py b/tools/asn2wrs.py index 3e4aa1ea71..c8ed5f87aa 100755 --- a/tools/asn2wrs.py +++ b/tools/asn2wrs.py @@ -3676,7 +3676,8 @@ class Constraint (Node): def Needs64b(self, ectx): (minv, maxv, ext) = self.GetValue(ectx) if ((str(minv).isdigit() or ((str(minv)[0] == "-") and str(minv)[1:].isdigit())) \ - and str(maxv).isdigit() and (abs(int(maxv) - int(minv)) >= 2**32)) \ + and (str(maxv).isdigit() or ((str(maxv)[0] == "-") and str(maxv)[1:].isdigit())) \ + and ((abs(int(maxv) - int(minv)) >= 2**32) or (int(minv) < -2**31) or (int(maxv) >= 2**32))) \ or (maxv == 'MAX') or (minv == 'MIN'): return True return False