Make sure source strings are terminated (#1641)
* Make sure source strings are terminated The source strings may or may not have a null terminator. We need to make sure we add one before outputting the source strings as we iterate over the c-str looking for the null terminator. * Review feedback
This commit is contained in:
parent
6eab476e5a
commit
e96fa717d3
2 changed files with 6 additions and 3 deletions
|
|
@ -879,8 +879,11 @@ bool ProcessDeferred(
|
|||
intermediate.setHlslOffsets();
|
||||
if (messages & EShMsgDebugInfo) {
|
||||
intermediate.setSourceFile(names[numPre]);
|
||||
for (int s = 0; s < numStrings; ++s)
|
||||
intermediate.addSourceText(strings[numPre + s]);
|
||||
for (int s = 0; s < numStrings; ++s) {
|
||||
// The string may not be null-terminated, so make sure we provide
|
||||
// the length along with the string.
|
||||
intermediate.addSourceText(strings[numPre + s], lengths[numPre + s]);
|
||||
}
|
||||
}
|
||||
SetupBuiltinSymbolTable(version, profile, spvVersion, source);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue