diff options
| author | aidanfnv <aidanf@nvidia.com> | 2025-04-07 07:01:50 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-07 14:01:50 +0000 |
| commit | 9972a5269f87618e237cd927b859636322596a76 (patch) | |
| tree | 0cde247d105eb170989f1d3517029859aaab3039 /source/slang/slang-reflection-api.cpp | |
| parent | edb7289383538c3356ca2d5f7c37f41821bbf252 (diff) | |
Return non-escaped strings from user-defined attributes (#6735)
Fixes #6624
This commit changes the behavior of getArgumentValueString() to return
the string's value, instead of returning the string's token,
as that token also contains the surrounding quotation marks.
This commit also modifies the relevant unit test accordingly,
to not check for the surrounding quotations.
Diffstat (limited to 'source/slang/slang-reflection-api.cpp')
| -rw-r--r-- | source/slang/slang-reflection-api.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/slang/slang-reflection-api.cpp b/source/slang/slang-reflection-api.cpp index 5dfa9d55a..065c2c3f6 100644 --- a/source/slang/slang-reflection-api.cpp +++ b/source/slang/slang-reflection-api.cpp @@ -378,8 +378,8 @@ SLANG_API const char* spReflectionUserAttribute_GetArgumentValueString( if (auto cexpr = as<StringLiteralExpr>(userAttr->args[index])) { if (bufLen) - *bufLen = cexpr->token.getContentLength(); - return cexpr->token.getContent().begin(); + *bufLen = cexpr->value.getLength(); + return cexpr->value.getBuffer(); } return nullptr; } |
