From 1905d7c090a13a8b94e5d19a5388104f2d7693fd Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sun, 3 May 2020 16:53:36 +0200 Subject: 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 --- prog/size.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'prog/size.go') 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. -- cgit mrf-deployment