[all-commits] [llvm/llvm-project] 50921a: [FuzzMutate] Fix a bug in `connectToSink` which mi...

Peter Rong via All-commits all-commits at lists.llvm.org
Tue Nov 29 13:07:38 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 50921a2174405fbac04a4c9aaeb6993153f05703
      https://github.com/llvm/llvm-project/commit/50921a2174405fbac04a4c9aaeb6993153f05703
  Author: Peter Rong <PeterRong96 at gmail.com>
  Date:   2022-11-29 (Tue, 29 Nov 2022)

  Changed paths:
    M llvm/lib/FuzzMutate/RandomIRBuilder.cpp
    M llvm/unittests/FuzzMutate/RandomIRBuilderTest.cpp

  Log Message:
  -----------
  [FuzzMutate] Fix a bug in `connectToSink` which might invalidate the whole module.

`connectToSink` uses a value by putting it in a future instruction.
It will replace the operand of a future instruction with the current value.

However, if current value is an `Instruction` and put into a switch case, the module is invalid.
We fix that by only connecting to Br/Switch's condition, and don't touch other operands.

Will have other strategies to mutate other Br/Switch operands to be patched once this patch is passed

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D138890




More information about the All-commits mailing list