From 441f4fcc08ae33f36e5a15a9dd5abde3f0797921 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 6 May 2024 08:33:51 +0200 Subject: prog: fix validation of DataMmapProg Allow to serialize/deserialize DataMmapProg and fix validation in debug mode. Fixes #4750 --- prog/mutation.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'prog/mutation.go') diff --git a/prog/mutation.go b/prog/mutation.go index 8547be3cc..c6cd3c7cf 100644 --- a/prog/mutation.go +++ b/prog/mutation.go @@ -55,6 +55,9 @@ func (o MutateOpts) weight() int { func (p *Prog) MutateWithOpts(rs rand.Source, ncalls int, ct *ChoiceTable, noMutate map[int]bool, corpus []*Prog, opts MutateOpts) { + if p.isUnsafe { + panic("mutation of unsafe programs is not supposed to be done") + } totalWeight := opts.weight() r := newRand(p.Target, rs) if ncalls < len(p.Calls) { -- cgit mrf-deployment