forked from OSchip/llvm-project
[JITLink] Fix think-o in handwritten CWrapperFunctionResult -> Error converter.
We need to skip the length field when generating error strings. No test case: This hand-hacked deserializer should be removed in the near future once JITLink can use generic ORC APIs (including SPS and WrapperFunction).
This commit is contained in:
parent
f453e23e67
commit
9d5e647428
|
@ -40,8 +40,9 @@ Error toError(CWrapperFunctionResult R) {
|
|||
char *Content = Large ? R.Data.ValuePtr : R.Data.Value;
|
||||
if (Content[0]) {
|
||||
HasError = true;
|
||||
ErrMsg.resize(R.Size - 1);
|
||||
memcpy(&ErrMsg[0], Content + 1, R.Size - 1);
|
||||
constexpr unsigned StrStart = 1 + sizeof(uint64_t);
|
||||
ErrMsg.resize(R.Size - StrStart);
|
||||
memcpy(&ErrMsg[0], Content + StrStart, R.Size - StrStart);
|
||||
}
|
||||
if (Large)
|
||||
free(R.Data.ValuePtr);
|
||||
|
|
Loading…
Reference in New Issue