diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-05-03 16:53:36 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-05-05 14:01:52 +0200 |
| commit | 1905d7c090a13a8b94e5d19a5388104f2d7693fd (patch) | |
| tree | 35a501ee366d2d41b46da91af19a01485f9bae66 /prog/size.go | |
| parent | 3dda7e67688077f3c6f91450d18dc14c776d3872 (diff) | |
prog: refactor ANY to not fabricate new types
Currently ANY implementation fabricates new types dynamically.
This is something we don't do anywhere else, generally types
come from compiler and all are static.
Dynamic types will conflict with use of Ref in Arg optimization.
Move ANY types creation into compiler.
Update #1580
Diffstat (limited to 'prog/size.go')
| -rw-r--r-- | prog/size.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/prog/size.go b/prog/size.go index 61d382723..6eccec50f 100644 --- a/prog/size.go +++ b/prog/size.go @@ -55,7 +55,7 @@ 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 typ := buf.Type(); typ == target.any.ptrPtr || typ == target.any.ptr64 { // 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. |
