gno
gno copied to clipboard
fix(gnovm): Add panic on `Deepfill` execution on constant type
Fix: #4777 Fix: #4956
DeepFill replace all references (RefValue) with concrete values loaded from storage.
StringValue, BigintValue, and BigdecValue are value types that are never persisted as separate objects. They lack ObjectInfo (ref gnovm/pkg/gnolang/ownership.go:144) and are used for:
- Constant expressions (embedded in
ConstExprnodes during preprocessing) - Runtime untyped values (e.g.,
UntypedBigintTypeoperations ingnovm/pkg/gnolang/op_binary.go:693)
Because these types are never persisted separately, they should never appear as RefValue that require DeepFill.
This is confirmed by their VisitAssociated implementations in gnovm/pkg/gnolang/garbage_collector.go:378-386, which return false indicating no associated values to visit during GC.
This PR adds guards in typedValue Deepfill to avoid their execution, and panic when Deepfill is called on these constant-only types.