From 377f0cab2613de3f9c67cd881db7170b63eb862d Mon Sep 17 00:00:00 2001 From: Dejan Mircevski Date: Tue, 19 Jan 2016 10:17:33 -0500 Subject: [PATCH] Fix merge issues. --- SPIRV/spvIR.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SPIRV/spvIR.h b/SPIRV/spvIR.h index 307711bf..91e42aa3 100755 --- a/SPIRV/spvIR.h +++ b/SPIRV/spvIR.h @@ -176,7 +176,7 @@ public: // Returns the block's merge instruction, if one exists (otherwise null). const Instruction* getMergeInstruction() const { if (instructions.size() < 2) return nullptr; - const Instruction* nextToLast = *(instructions.cend() - 2); + const Instruction* nextToLast = (instructions.cend() - 2)->get(); switch (nextToLast->getOpCode()) { case OpSelectionMerge: case OpLoopMerge: @@ -375,7 +375,7 @@ __inline Block::Block(Id id, Function& parent) : parent(parent), unreachable(fal { instructions.push_back(std::unique_ptr(new Instruction(id, NoType, OpLabel))); instructions.back()->setBlock(this); - parent.getParent().mapInstruction(instructions.back()); + parent.getParent().mapInstruction(instructions.back().get()); } __inline void Block::addInstruction(std::unique_ptr inst)