From ecbb06e74072d0902726bb10853f144842f443b8 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Mon, 9 Mar 2020 11:41:01 -0700 Subject: [PATCH] trap iteration of non-Struct --- src/data.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/data.cpp b/src/data.cpp index 2997cb8..4ffcf1e 100644 --- a/src/data.cpp +++ b/src/data.cpp @@ -745,7 +745,11 @@ void Value::_iter_fl(Value::IterInfo &info, bool first) const if(!store) throw NoField(); - if(info.depth) { + if(desc->code!=TypeCode::Struct) { + // TODO implement iteration of Union, or Struct[]/Union[] + info.pos = info.nextcheck = 0; + + } else if(info.depth) { info.pos = info.nextcheck = first ? 1u : desc->size(); if(info.marked)