diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2018-07-16 10:53:46 -0400 |
---|---|---|
committer | David Neto <dneto@google.com> | 2018-07-16 14:18:53 -0400 |
commit | 8c7dab5caa539af3acb52d76c1e3bf3888061a0d (patch) | |
tree | 3620a62b15eeeb669691d207c4452515ea567d78 /source | |
parent | 208921efe813b457ee909693a270233fbb012987 (diff) |
Fixup line number for OpVectorShuffle ID error.
This CL updates the code to pull a valid instruction for the line number
when outputting a component error in OpVectorShuffle. The error line
isn't the best at this point as it points at the component, but it's
better then a -1 (turning to max<size_t>) that was being output.
The error messages has been updated to better reflect what the error is
attempting to say.
Issue 1719.
Diffstat (limited to 'source')
-rw-r--r-- | source/val/validate_id.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/val/validate_id.cpp b/source/val/validate_id.cpp index 1ceab202..91b6cde2 100644 --- a/source/val/validate_id.cpp +++ b/source/val/validate_id.cpp @@ -1781,9 +1781,9 @@ bool idUsage::isValid<SpvOpVectorShuffle>(const spv_instruction_t* inst, for (size_t i = firstLiteralIndex; i < inst->words.size(); ++i) { auto literal = inst->words[i]; if (literal != 0xFFFFFFFF && literal >= N) { - DIAG(module_.FindDef(inst->words[0])) - << "Component literal value " << literal << " is greater than " - << N - 1 << "."; + DIAG(module_.FindDef(inst->words[2])) + << "Component index " << literal << " is out of range for a result " + << "vector of size " << N << "."; return false; } } |