mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-07-11 18:17:16 +00:00
Handle non-void return instructions properly in DXIL
This commit is contained in:
@@ -1293,22 +1293,12 @@ Program::Program(const byte *bytes, size_t length) : alloc(32 * 1024)
|
||||
}
|
||||
else if(op.type == FunctionRecord::INST_RET)
|
||||
{
|
||||
Instruction *inst = NULL;
|
||||
// even rets returning a value are still void
|
||||
Instruction *inst = new(alloc) Instruction;
|
||||
inst->type = GetVoidType();
|
||||
|
||||
if(op.remaining() == 0)
|
||||
{
|
||||
inst = new(alloc) Instruction;
|
||||
inst->type = GetVoidType();
|
||||
|
||||
RDCASSERT(inst->type);
|
||||
}
|
||||
else
|
||||
{
|
||||
inst = values.nextValue<Instruction>();
|
||||
if(op.remaining() != 0)
|
||||
inst->args.push_back(op.getSymbol());
|
||||
inst->type = inst->args.back()->type;
|
||||
values.addValue();
|
||||
}
|
||||
|
||||
inst->op = Operation::Ret;
|
||||
|
||||
|
||||
@@ -732,7 +732,14 @@ void Program::MakeDisassemblyString()
|
||||
|
||||
break;
|
||||
}
|
||||
case Operation::Ret: m_Disassembly += "ret " + inst.type->toString(); break;
|
||||
case Operation::Ret:
|
||||
{
|
||||
if(inst.args.empty())
|
||||
m_Disassembly += "ret " + inst.type->toString();
|
||||
else
|
||||
m_Disassembly += "ret " + argToString(inst.args[0], true);
|
||||
break;
|
||||
}
|
||||
case Operation::Unreachable: m_Disassembly += "unreachable"; break;
|
||||
case Operation::Alloca:
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user