@@ -318,7 +318,7 @@ spv_result_t Parser::parseInstruction() {
318318 return diagnostic () << " Invalid instruction word count: "
319319 << inst_word_count;
320320 }
321- spvtools::InstructionDesc* opcode_desc = nullptr ;
321+ const spvtools::InstructionDesc* opcode_desc = nullptr ;
322322 if (spvtools::LookupOpcode (static_cast <spv::Op>(inst.opcode ), &opcode_desc))
323323 return diagnostic () << " Invalid opcode: " << inst.opcode ;
324324
@@ -522,7 +522,7 @@ spv_result_t Parser::parseOperand(size_t inst_offset,
522522 return diagnostic ()
523523 << " Invalid " << spvOperandTypeStr (type) << " : " << word;
524524 }
525- spvtools::InstructionDesc* opcode_entry = nullptr ;
525+ const spvtools::InstructionDesc* opcode_entry = nullptr ;
526526 if (spvtools::LookupOpcode (spv::Op (word), &opcode_entry)) {
527527 return diagnostic (SPV_ERROR_INTERNAL)
528528 << " OpSpecConstant opcode table out of sync" ;
@@ -688,7 +688,7 @@ spv_result_t Parser::parseOperand(size_t inst_offset,
688688 if (type == SPV_OPERAND_TYPE_OPTIONAL_FPENCODING)
689689 parsed_operand.type = SPV_OPERAND_TYPE_FPENCODING;
690690
691- spvtools::OperandDesc* entry = nullptr ;
691+ const spvtools::OperandDesc* entry = nullptr ;
692692 if (spvtools::LookupOperand (type, word, &entry)) {
693693 return diagnostic ()
694694 << " Invalid " << spvOperandTypeStr (parsed_operand.type )
@@ -699,7 +699,7 @@ spv_result_t Parser::parseOperand(size_t inst_offset,
699699 } break ;
700700
701701 case SPV_OPERAND_TYPE_SOURCE_LANGUAGE: {
702- spvtools::OperandDesc* entry = nullptr ;
702+ const spvtools::OperandDesc* entry = nullptr ;
703703 if (spvtools::LookupOperand (type, word, &entry)) {
704704 return diagnostic ()
705705 << " Invalid " << spvOperandTypeStr (parsed_operand.type )
@@ -754,7 +754,7 @@ spv_result_t Parser::parseOperand(size_t inst_offset,
754754 uint32_t remaining_word = word;
755755 for (uint32_t mask = (1u << 31 ); remaining_word; mask >>= 1 ) {
756756 if (remaining_word & mask) {
757- spvtools::OperandDesc* entry = nullptr ;
757+ const spvtools::OperandDesc* entry = nullptr ;
758758 if (spvtools::LookupOperand (type, mask, &entry)) {
759759 return diagnostic ()
760760 << " Invalid " << spvOperandTypeStr (parsed_operand.type )
@@ -767,7 +767,7 @@ spv_result_t Parser::parseOperand(size_t inst_offset,
767767 }
768768 if (word == 0 ) {
769769 // An all-zeroes mask *might* also be valid.
770- spvtools::OperandDesc* entry = nullptr ;
770+ const spvtools::OperandDesc* entry = nullptr ;
771771 if (SPV_SUCCESS == spvtools::LookupOperand (type, 0 , &entry)) {
772772 // Prepare for its operands, if any.
773773 spvPushOperandTypes (entry->operands (), expected_operands);
0 commit comments