From ed0f6c3fc6b320617f234b62e3fe0edc7f80cb4c Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Thu, 12 Mar 2020 10:14:48 -0700 Subject: [PATCH] Value::assign() handle !valid() --- src/data.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/data.cpp b/src/data.cpp index a6723fe..064e638 100644 --- a/src/data.cpp +++ b/src/data.cpp @@ -151,7 +151,10 @@ Value Value::clone() const Value& Value::assign(const Value& o) { - if(desc!=o.desc && + if(!desc || !o.desc) { + // handled below + + } else if(desc!=o.desc && desc->code==o.desc->code && (desc->code.kind()==Kind::Integer || desc->code.kind()==Kind::Real @@ -165,7 +168,7 @@ Value& Value::assign(const Value& o) throw std::runtime_error("Can only assign same TypeDef"); } - if(desc) { + if(desc && o.desc) { for(size_t bit=0, end=desc->size(); bit