[all-commits] [llvm/llvm-project] 348189: [IR Verifier] didn't check if switch case is const...

Peter Rong via All-commits all-commits at lists.llvm.org
Thu Nov 3 15:29:20 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 348189880b7bc9513ccdd0ea3a1e255b4d3190e7
      https://github.com/llvm/llvm-project/commit/348189880b7bc9513ccdd0ea3a1e255b4d3190e7
  Author: Peter Rong <PeterRong96 at gmail.com>
  Date:   2022-11-03 (Thu, 03 Nov 2022)

  Changed paths:
    M llvm/lib/IR/Verifier.cpp
    M llvm/unittests/IR/VerifierTest.cpp

  Log Message:
  -----------
  [IR Verifier] didn't check if switch case is constant, align IR Verifier's check with LLParser.

If a programmer incorrectly `Switch->setOperand()` and `Verifier` will pass, causing problems when dumping this `Module`
This patch aligns SwitchInst's check with LLParser. It also includes a test to justify the patch.

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




More information about the All-commits mailing list