Skip to content

Commit 5bb26b1

Browse files
unlsycnTaoBi22
authored andcommitted
[OM] Fix finalization of nested ReferenceValue
After instantiating an Object in the Evaluator, we recursively finalize its value to eliminate intermediate ReferenceValues, ensuring that the original type of om.any is preserved. This patch fixes an issue where, if a ReferenceValue remains a ReferenceValue after being stripped, the finalization process should continue but previously did not (e.g., a list of om.any that is an object returns another list of om.any that is also an object). Signed-off-by: unlsycn <[email protected]>
1 parent 735cf33 commit 5bb26b1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/Dialect/OM/Evaluator/Evaluator.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -803,6 +803,10 @@ LogicalResult circt::om::evaluator::ReferenceValue::finalizeImpl() {
803803
if (failed(result))
804804
return result;
805805
value = std::move(result.value());
806+
// the stripped value also needs to be finalized
807+
if (failed(finalizeEvaluatorValue(value)))
808+
return failure();
809+
806810
return success();
807811
}
808812

0 commit comments

Comments
 (0)