From e82404f36b8fdacaaea9b8775e09561edf365a9b Mon Sep 17 00:00:00 2001 From: Shixin Zeng Date: Thu, 20 Oct 2016 15:07:18 -0400 Subject: [PATCH] Initialize REBVAL in array returned from Alloc_Signular_Array The REBVAL in the array is not initialized, so Kill_Series will fail --- src/core/t-struct.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/t-struct.c b/src/core/t-struct.c index 8dfdad2a26..747becbca2 100644 --- a/src/core/t-struct.c +++ b/src/core/t-struct.c @@ -1348,6 +1348,10 @@ void MAKE_Struct(REBVAL *out, enum Reb_Kind type, const REBVAL *arg) { REBSTU *stu = Alloc_Singular_Array(); + // Set it to blank so the Kill_Series can be called upon in case of error thrown + // before it is fully constructed. + SET_BLANK(ARR_HEAD(stu)); + MANAGE_SERIES(field_1); ARR_SERIES(stu)->link.schema = field_1;