aboutsummaryrefslogtreecommitdiffstats
path: root/prog/resources.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-02-24 14:33:36 +0100
committerDmitry Vyukov <dvyukov@google.com>2018-02-25 18:22:02 +0100
commit9fe8aa42c5bd11e2eb6952a16da6287205d7bf97 (patch)
tree7cf636dd611cb2a338cfeba13607b8e152545f19 /prog/resources.go
parent2145057cb8a50aba1a27a67be19953bee9b164fd (diff)
prog: add arbitrary mutation of complex structs
Squash complex structs into flat byte array and mutate this array with generic blob mutations. This allows to mutate what we currently consider as paddings and add/remove paddings from structs, etc.
Diffstat (limited to 'prog/resources.go')
-rw-r--r--prog/resources.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/prog/resources.go b/prog/resources.go
index f7d124848..6ae33c83f 100644
--- a/prog/resources.go
+++ b/prog/resources.go
@@ -33,6 +33,9 @@ func (target *Target) calcResourceCtors(kind []string, precise bool) []*Syscall
// isCompatibleResource returns true if resource of kind src can be passed as an argument of kind dst.
func (target *Target) isCompatibleResource(dst, src string) bool {
+ if dst == target.anyRes32.TypeName || dst == target.anyRes64.TypeName {
+ return true
+ }
dstRes := target.resourceMap[dst]
if dstRes == nil {
panic(fmt.Sprintf("unknown resource '%v'", dst))