From 818c77dd7818d3c56513a0ef417fd61bb8bb5927 Mon Sep 17 00:00:00 2001 From: Florent Revest Date: Wed, 5 Jul 2023 14:25:52 +0200 Subject: prog: keep ConstMap after target initialization It can be useful to retrieve constants from their names to factorize constant into flag masks in syz-prog2c for example. --- prog/target.go | 4 ---- 1 file changed, 4 deletions(-) (limited to 'prog') diff --git a/prog/target.go b/prog/target.go index 761dce34a..2889b8bf0 100644 --- a/prog/target.go +++ b/prog/target.go @@ -148,7 +148,6 @@ func (target *Target) lazyInit() { } } // These are used only during lazyInit. - target.ConstMap = nil target.types = nil } @@ -176,9 +175,6 @@ func (target *Target) initTarget() { } func (target *Target) GetConst(name string) uint64 { - if target.ConstMap == nil { - panic("GetConst can only be used during target initialization") - } v, ok := target.ConstMap[name] if !ok { panic(fmt.Sprintf("const %v is not defined for %v/%v", name, target.OS, target.Arch)) -- cgit mrf-deployment