iOS Parsing Error

Hi,

When compiling mumble-iphone from https://github.com/mumble-voip/mumble-iphoneos I had a parser error on the file CodeOutputStream.m (form https://github.com/booyah/protobuf-objc/tree/696b7b61cdd4e8d77c55ace98b3119194fa04b7f).

I know that the code form protobuf is old but maybe there is an issue in the parser.

I get the following error (this is working well with the llvm from Apple):

/src/runtime/Classes/CodedOutputStream.m:389:47: current parser token ‘{’
clang-3.9: error: unable to execute command: Segmentation fault: 11

I have no experience with the front-end but it seems that the issue is at the end of the file (I have attached the file).

If you remove the function writeRawLittleEndian32 and writeRawLittleEndian64, the parser does not indicate any error (maybe the error is in writeRawVarint64 and it is propagate to the next function).

Greetings,

Johan

CodedOutputStream.m (11 KB)

Hi,

When compiling mumble-iphone from https://github.com/
mumble-voip/mumble-iphoneos I had a parser error on the file
CodeOutputStream.m (form https://github.com/booyah/protobuf-objc/tree/
696b7b61cdd4e8d77c55ace98b3119194fa04b7f).

I know that the code form protobuf is old but maybe there is an issue in
the parser.

I get the following error (this is working well with the llvm from Apple):

/src/runtime/Classes/CodedOutputStream.m:389:47: current parser token '{'
clang-3.9: error: unable to execute command: Segmentation fault: 11

I have no experience with the front-end but it seems that the issue is at
the end of the file (I have attached the file).

If you remove the function writeRawLittleEndian32 and
writeRawLittleEndian64, the parser does not indicate any error (maybe the
error is in writeRawVarint64 and it is propagate to the next function).

Hi Johan,

I tried reproducing this issue with clang-3.9 and top of tree clang but I
failed with both. Can you please describe your exact configuration and
compiler arguments? Running clang with the `-v` option turned on should
give you this information.

As well as that, can you please attach the exact preprocessed output of
'CodedOutputStream.m' as well? You can obtain it by running `clang -E` on
that file.

Cheers,
Alex

Hi Alex,

Sorry for the delay, my mail was blocked due to the size of the file and I did not notice it.

I have run the compilation with the -v and put the result into https://reviews.llvm.org/P7926

I am just running a pass with the following runOnFunction:

bool MyPass::runOnFunction(Function &F) {
std::string ErrorStr;
raw_string_ostream OS(ErrorStr);

// Check if the function is still correct.
if (verifyFunction(F, &OS)) {
std::string mess = “[” + std::string(ctp.str) + "]\tFunction " +
F.getName().str() + " error during pass " +
OS.str() + “\n”;
F.getContext().emitError(Twine(mess));
}

return false;
}

I have run clang -E on the file and put the result in https://reviews.llvm.org/P7927

Greetings,

Johan