| 113 | } |
| 114 | |
| 115 | spv_result_t ValidateAbort(ValidationState_t& _, const Instruction* inst) { |
| 116 | const auto message_type = _.FindDef(inst->GetOperandAs<uint32_t>(0u)); |
| 117 | const auto source = _.FindDef(inst->GetOperandAs<uint32_t>(1u)); |
| 118 | const auto source_type = _.FindDef(source->type_id()); |
| 119 | |
| 120 | if (source_type == message_type) return SPV_SUCCESS; |
| 121 | |
| 122 | if (!_.LogicallyMatch(source_type, message_type, false)) { |
| 123 | return _.diag(SPV_ERROR_INVALID_ID, inst) |
| 124 | << "Type of Message operand does not logically match the type of " |
| 125 | "the Message Type operand"; |
| 126 | } |
| 127 | |
| 128 | return SPV_SUCCESS; |
| 129 | } |
| 130 | |
| 131 | } // namespace |
| 132 |
no test coverage detected