================ @@ -5918,12 +5918,19 @@ clang_EvalResult_getAsUnsigned(CXEvalResult E); CINDEX_LINKAGE double clang_EvalResult_getAsDouble(CXEvalResult E); /** - * Returns the evaluation result as a constant string if the - * kind is other than Int or float. User must not free this pointer, - * instead call clang_EvalResult_dispose on the CXEvalResult returned - * by clang_Cursor_Evaluate. + * This function behaves the same as clang_EvalResult_getAsCXString, with 2 + * exceptions: + * - the string literal will be truncated if a nul byte is found in the string. + * For this reason clang_EvalResult_getAsCXString is recommended. + * - User must not free this pointer, instead call clang_EvalResult_dispose on + * the CXEvalResult returned by clang_Cursor_Evaluate. */ CINDEX_LINKAGE const char *clang_EvalResult_getAsStr(CXEvalResult E); +/** + * Returns the evaluation result as a constant string if the + * kind is other than Int or float. This might include zero bytes. ---------------- AaronBallman wrote:
We should document that the caller is responsible for destroying the returned object. https://github.com/llvm/llvm-project/pull/134551 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits