Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(456)

Side by Side Diff: src/IceCompileServer.cpp

Issue 1182323011: Fix handling of TYPE_CODE_NUMENTRY record when size large. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nits. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Makefile.standalone ('k') | src/PNaClTranslator.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceCompileServer.cpp - Compile server ------------------===// 1 //===- subzero/src/IceCompileServer.cpp - Compile server ------------------===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 //
10 // This file defines the basic commandline-based compile server. 10 // This file defines the basic commandline-based compile server.
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 llvm::SmallVector<char, 1024> BitcodeBuffer; 52 llvm::SmallVector<char, 1024> BitcodeBuffer;
53 size_t Cursor = 0; 53 size_t Cursor = 0;
54 }; 54 };
55 55
56 TextDataStreamer *TextDataStreamer::create(const IceString &Filename, 56 TextDataStreamer *TextDataStreamer::create(const IceString &Filename,
57 std::string *Err) { 57 std::string *Err) {
58 TextDataStreamer *Streamer = new TextDataStreamer(); 58 TextDataStreamer *Streamer = new TextDataStreamer();
59 llvm::raw_string_ostream ErrStrm(*Err); 59 llvm::raw_string_ostream ErrStrm(*Err);
60 if (std::error_code EC = llvm::readNaClRecordTextAndBuildBitcode( 60 if (std::error_code EC = llvm::readNaClRecordTextAndBuildBitcode(
61 Filename, Streamer->BitcodeBuffer, &ErrStrm)) { 61 Filename, Streamer->BitcodeBuffer, &ErrStrm)) {
62 ErrStrm << "Error: " << EC.message() << "\n"; 62 ErrStrm << EC.message(); // << "\n";
63 ErrStrm.flush(); 63 ErrStrm.flush();
64 delete Streamer; 64 delete Streamer;
65 return nullptr; 65 return nullptr;
66 } 66 }
67 ErrStrm.flush(); 67 // ErrStrm.flush();
68 return Streamer; 68 return Streamer;
69 } 69 }
70 70
71 size_t TextDataStreamer::GetBytes(unsigned char *Buf, size_t Len) { 71 size_t TextDataStreamer::GetBytes(unsigned char *Buf, size_t Len) {
72 if (Cursor >= BitcodeBuffer.size()) 72 if (Cursor >= BitcodeBuffer.size())
73 return 0; 73 return 0;
74 size_t Remaining = BitcodeBuffer.size(); 74 size_t Remaining = BitcodeBuffer.size();
75 Len = std::min(Len, Remaining); 75 Len = std::min(Len, Remaining);
76 for (size_t i = 0; i < Len; ++i) 76 for (size_t i = 0; i < Len; ++i)
77 Buf[i] = BitcodeBuffer[Cursor + i]; 77 Buf[i] = BitcodeBuffer[Cursor + i];
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 }); 168 });
169 CompileThread.join(); 169 CompileThread.join();
170 } else { 170 } else {
171 getCompiler().run(ExtraFlags, *Ctx.get(), std::move(InputStream)); 171 getCompiler().run(ExtraFlags, *Ctx.get(), std::move(InputStream));
172 } 172 }
173 transferErrorCode(getReturnValue( 173 transferErrorCode(getReturnValue(
174 ExtraFlags, static_cast<ErrorCodes>(Ctx->getErrorStatus()->value()))); 174 ExtraFlags, static_cast<ErrorCodes>(Ctx->getErrorStatus()->value())));
175 } 175 }
176 176
177 } // end of namespace Ice 177 } // end of namespace Ice
OLDNEW
« no previous file with comments | « Makefile.standalone ('k') | src/PNaClTranslator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698