]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: stop constructing untyped nodes when instrumenting asan
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Thu, 13 Apr 2023 10:44:32 +0000 (17:44 +0700)
committerCuong Manh Le <cuong.manhle.vn@gmail.com>
Fri, 14 Apr 2023 17:58:12 +0000 (17:58 +0000)
commit70451004bd9d30257aa0c9d02df27a51d9367e73
treedf3df494f8f497aab2420197bc1bcca150ad1bd4
parent74b52d9519f4060514e897e90bfc5a50e049bc78
cmd/compile: stop constructing untyped nodes when instrumenting asan

The code is using typecheck.ConvNop to convert from untyped int to
uintptr. However, that left the literal node untyped. It often does not
matter, because typecheck.EvalConst will see the OCONVNOP, and replace
the node with a new constant node.

This CL changes the code to construct the constant node directly using
typecheck.DefaultLit, so the last dependecy of typecheck.EvalConst will
go away, next CL can safely remove it from the code base.

Change-Id: Ie5a3d1ff6d3b72be7b8c43170eaa4f6cbb3206fc
Reviewed-on: https://go-review.googlesource.com/c/go/+/484317
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/cmd/compile/internal/pkginit/init.go
src/cmd/compile/internal/pkginit/initAsanGlobals.go