gno icon indicating copy to clipboard operation
gno copied to clipboard

fix(gnovm): Add panic on `Deepfill` execution on constant type

Open Davphla opened this issue 1 month ago • 4 comments

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 ConstExpr nodes during preprocessing)
  • Runtime untyped values (e.g., UntypedBigintType operations in gnovm/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.

Davphla avatar Nov 17 '25 14:11 Davphla