From 40154b35f0888fabcd3d8cd96db71e8458e6ea74 Mon Sep 17 00:00:00 2001 From: lisa neigut Date: Tue, 23 Jul 2019 16:00:06 -0500 Subject: [PATCH] bolt-gen: make needs-context not recursive originally done so that any field within a subtype needed context, that would be reflected at the top-most layer. in reality, we allocate subtype fields off of the instance of the subtype, so there's no need to check beneath the 'top' layer of field/types in a message to determine whether or not to pass in a context. --- tools/generate-bolts.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/generate-bolts.py b/tools/generate-bolts.py index b0495bcc2..6ed9c5a1c 100755 --- a/tools/generate-bolts.py +++ b/tools/generate-bolts.py @@ -87,8 +87,7 @@ class Field(object): return self.len_field def needs_context(self): - """ A field needs a context if its type needs context - or if it's varsized """ + """ A field needs a context if it's varsized """ return self.is_varlen() or self.type_obj.needs_context() def arg_desc_to(self): @@ -286,7 +285,7 @@ class Type(FieldSet): return self.name in self.truncated_typedefs def needs_context(self): - return self.is_varsize() or any([field.needs_context() for field in self.fields.values()]) + return self.is_varsize() def is_assignable(self): """ Generally typedef's and enums """