From 809b04eb484b75d8c0e26ba12642ed34bc6b1fd7 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Sat, 16 Oct 2021 16:27:41 +1100 Subject: [PATCH] oceani: don't allocate init value for non-initialized fields. Struct fields that aren't explicitly initialised must be initialized to a 'null' value. This can happen at interp-time. There is no need to allocate a null value when parsing. Signed-off-by: NeilBrown --- csrc/oceani.mdc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/csrc/oceani.mdc b/csrc/oceani.mdc index 416084e..fedf05f 100644 --- a/csrc/oceani.mdc +++ b/csrc/oceani.mdc @@ -1978,7 +1978,8 @@ function will be needed. $0 = calloc(1, sizeof(struct fieldlist)); $0->f.name = $1.txt; $0->f.type = $<3; - $0->f.init = val_alloc($0->f.type, NULL); + if ($0->f.type->prepare_type) + $0->f.type->prepare_type($0->f.type); }$ ###### forward decls -- 2.43.0