From d4a10590b7642ebd9c3f79cb2beabe9395f1b1c8 Mon Sep 17 00:00:00 2001 From: Greg Fischer Date: Wed, 14 Nov 2018 15:25:51 -0700 Subject: [PATCH] Fix Instruction::IsFloatingPointFoldingAllowed() Was looking for decorations based on opcode. Should use result_id. --- source/opt/instruction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/opt/instruction.cpp b/source/opt/instruction.cpp index 15aa24f07..5f3c5a889 100644 --- a/source/opt/instruction.cpp +++ b/source/opt/instruction.cpp @@ -513,7 +513,7 @@ bool Instruction::IsFloatingPointFoldingAllowed() const { bool is_nocontract = false; context_->get_decoration_mgr()->WhileEachDecoration( - opcode_, SpvDecorationNoContraction, + result_id(), SpvDecorationNoContraction, [&is_nocontract](const Instruction&) { is_nocontract = true; return false;