diff --git a/source/lang/evaluator.cpp b/source/lang/evaluator.cpp index c6831bc70..579894557 100644 --- a/source/lang/evaluator.cpp +++ b/source/lang/evaluator.cpp @@ -358,12 +358,10 @@ namespace hex::lang { this->m_currEndian.reset(); - if (entries.empty()) - throwEvaluateError("array size must be greater than zero", node->getLineNumber()); - - PatternData *pattern; - if (dynamic_cast(entries[0])) + if (entries.empty()) + pattern = new PatternDataPadding(startOffset, 0); + else if (dynamic_cast(entries[0])) pattern = new PatternDataString(startOffset, (this->m_currOffset - startOffset), color.value_or(0)); else pattern = new PatternDataArray(startOffset, (this->m_currOffset - startOffset), entries, color.value_or(0));