diff options
Diffstat (limited to 'prog/size.go')
| -rw-r--r-- | prog/size.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/prog/size.go b/prog/size.go index b621cb6bc..3b0bf0b0f 100644 --- a/prog/size.go +++ b/prog/size.go @@ -47,6 +47,12 @@ func (target *Target) assignSize(dst *ConstArg, pos Arg, path []string, args []A offset += buf.Size() continue } + if typ := buf.Type().Name(); typ == target.any.ptrPtr.Name() || typ == target.any.ptr64.Name() { + // If path points into squashed argument, we don't have the target argument. + // In such case we simply leave size argument as is. It can't happen during generation, + // only during mutation and mutation can set size to random values, so it should be fine. + return + } buf = InnerArg(buf) if buf == nil { dst.Val = 0 // target is an optional pointer |
