Fix error in STATIC_ASSERT with multiple files (issue #203)
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>
Wed, 25 May 2016 15:03:33 +0000 (18:03 +0300)
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>
Wed, 25 May 2016 15:05:05 +0000 (18:05 +0300)
The FieldMaxSize class was reusing the same list instance,
causing problems when multiple files were specified on the
protoc command line.

generator/nanopb_generator.py

index 501affa..84f5d09 100755 (executable)
@@ -217,7 +217,7 @@ class FieldMaxSize:
             self.worst = worst
 
         self.worst_field = field_name
-        self.checks = checks
+        self.checks = list(checks)
 
     def extend(self, extend, field_name = None):
         self.worst = max(self.worst, extend.worst)