aboutsummaryrefslogtreecommitdiffstats
path: root/prog
diff options
context:
space:
mode:
authorFlorent Revest <revest@chromium.org>2023-07-05 14:25:52 +0200
committerAleksandr Nogikh <nogikh@google.com>2024-02-01 10:12:21 +0000
commit818c77dd7818d3c56513a0ef417fd61bb8bb5927 (patch)
treeaa51e809de17039514f503d5c74915f503214b5d /prog
parentaae5933bfab5f4a094c8483daeb8d55972e74c66 (diff)
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.
Diffstat (limited to 'prog')
-rw-r--r--prog/target.go4
1 files changed, 0 insertions, 4 deletions
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))