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

Side by Side Diff: courgette/disassembler.cc

Issue 1031513002: Robust ELF header parsing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "courgette/disassembler.h" 5 #include "courgette/disassembler.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 failure_reason_ = NULL; 118 failure_reason_ = NULL;
119 return true; 119 return true;
120 } 120 }
121 121
122 bool Disassembler::Bad(const char* reason) { 122 bool Disassembler::Bad(const char* reason) {
123 failure_reason_ = reason; 123 failure_reason_ = reason;
124 return false; 124 return false;
125 } 125 }
126 126
127 void Disassembler::ReduceLength(size_t reduced_length) { 127 void Disassembler::ReduceLength(size_t reduced_length) {
128 if (reduced_length < length_) 128 if (reduced_length < length_) {
rickyz (no longer on Chrome) 2015/03/23 23:14:50 Can this just be a CHECK instead?
halyavin2 2015/03/24 14:35:17 Done.
129 length_ = reduced_length; 129 length_ = reduced_length;
130 end_ = start_ + length_;
131 }
130 } 132 }
131 133
132 } // namespace courgette 134 } // namespace courgette
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698