summaryrefslogtreecommitdiffstats
path: root/courgette/ensemble.cc
diff options
context:
space:
mode:
authordcheng <dcheng@chromium.org>2016-01-28 19:14:24 -0800
committerCommit bot <commit-bot@chromium.org>2016-01-29 03:15:34 +0000
commit7958406fb94ffb798859006fef04dbd0d4164079 (patch)
tree2f7837ec4c53a3b7daa1a9313a2448d6b9c2bcca /courgette/ensemble.cc
parentb34b862c7cb041ac86a1bb28b35a76c6f716bb02 (diff)
downloadchromium_src-7958406fb94ffb798859006fef04dbd0d4164079.zip
chromium_src-7958406fb94ffb798859006fef04dbd0d4164079.tar.gz
chromium_src-7958406fb94ffb798859006fef04dbd0d4164079.tar.bz2
Revert of [Courgette] Refactor: Manage AssemblyProgram and EncodedProgram with scoped_ptr. (patchset #5 id:80001 of https://codereview.chromium.org/1629703002/ )
Reason for revert: Breaks ninja build on Linux GN. Original issue's description: > [Courgette] Refactor: Manage AssemblyProgram and EncodedProgram with scoped_ptr. > > Previously naked pointers AssemblyProgram and EncodedProgram are used over the > place, and are deallocated using Delete{AssemblyProgram, EncodedProgram}(). > In this CL we use scoped_ptr to manage the life cycles of these objects. > > - Removed DeleteAssemblyProgram() and DeleteEncodedProgram() and replaced calls > with e.g., program.reset(nullptr); if the manual deallocation is a peak > memory optimization. > - Moved Encode() and ReadEncodedProgram() to the .h files matching the .cc files. > - Extracted DetectExecutableType() and ParseDetectedExecutable() from > disassembly.* to new files program_detector*c, since Disassembly is really an > implementation that caller's don't care about. > > Committed: https://crrev.com/0a9cbf1781a114b35a4e0f4a834f2d24ade2e917 > Cr-Commit-Position: refs/heads/master@{#372212} TBR=wfh@chromium.org,grt@chromium.org,huangs@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1650013002 Cr-Commit-Position: refs/heads/master@{#372274}
Diffstat (limited to 'courgette/ensemble.cc')
-rw-r--r--courgette/ensemble.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/courgette/ensemble.cc b/courgette/ensemble.cc
index 631dd12..d5277a4 100644
--- a/courgette/ensemble.cc
+++ b/courgette/ensemble.cc
@@ -8,7 +8,7 @@
#include <stdint.h>
#include "base/strings/string_number_conversions.h"
-#include "courgette/program_detector.h"
+
#include "courgette/region.h"
#include "courgette/simple_delta.h"
#include "courgette/streams.h"
@@ -41,9 +41,11 @@ Status Ensemble::FindEmbeddedElements() {
while (position < length) {
ExecutableType type;
size_t detected_length;
+
Status result = DetectExecutableType(start + position,
length - position,
&type, &detected_length);
+
if (result == C_OK) {
Region region(start + position, detected_length);