Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c609c31f authored by Narayan Kamath's avatar Narayan Kamath
Browse files

libutils: Fix integer overflows in VectorImpl.

Use external/safe-iop to check for overflows on arithmetic
operations.

Also remove an unnecessary copy of Vector/SharedBuffer from
codeflinger and use the copy from libutils instead.

Note that some of the unit tests are somewhat useless due to
test-runner limitations : gtest's ability to filter on abort message
doesn't work when combined with messages formatted by android's logging
system.

bug: 22953624

Change-Id: I46b1ae8ca1f3a010be13aca36a091e76a97a7b70
parent d239dbb2
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -14,8 +14,6 @@ PIXELFLINGER_SRC_FILES:= \
	codeflinger/load_store.cpp \
	codeflinger/blending.cpp \
	codeflinger/texturing.cpp \
	codeflinger/tinyutils/SharedBuffer.cpp \
	codeflinger/tinyutils/VectorImpl.cpp \
	fixed.cpp.arm \
	picker.cpp.arm \
	pixelflinger.cpp.arm \
@@ -63,8 +61,9 @@ LOCAL_SRC_FILES_arm64 := $(PIXELFLINGER_SRC_FILES_arm64)
LOCAL_SRC_FILES_mips := $(PIXELFLINGER_SRC_FILES_mips)
LOCAL_CFLAGS := $(PIXELFLINGER_CFLAGS)
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
LOCAL_C_INCLUDES += $(LOCAL_EXPORT_C_INCLUDE_DIRS)
LOCAL_SHARED_LIBRARIES := libcutils liblog
LOCAL_C_INCLUDES += $(LOCAL_EXPORT_C_INCLUDE_DIRS) \
		    external/safe-iop/include
LOCAL_SHARED_LIBRARIES := libcutils liblog libutils

# Really this should go away entirely or at least not depend on
# libhardware, but this at least gets us built.
+2 −2
Original line number Diff line number Diff line
@@ -21,9 +21,9 @@
#include <stdint.h>
#include <sys/types.h>

#include "tinyutils/Vector.h"
#include "tinyutils/KeyedVector.h"
#include "tinyutils/smartpointer.h"
#include "utils/Vector.h"
#include "utils/KeyedVector.h"

#include "ARMAssemblerInterface.h"
#include "CodeCache.h"
+2 −2
Original line number Diff line number Diff line
@@ -32,9 +32,9 @@
#include <stdint.h>
#include <sys/types.h>

#include "tinyutils/Vector.h"
#include "tinyutils/KeyedVector.h"
#include "tinyutils/smartpointer.h"
#include "utils/Vector.h"
#include "utils/KeyedVector.h"

#include "tinyutils/smartpointer.h"
#include "codeflinger/ARMAssemblerInterface.h"
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@
#include <pthread.h>
#include <sys/types.h>

#include "tinyutils/KeyedVector.h"
#include "utils/KeyedVector.h"
#include "tinyutils/smartpointer.h"

namespace android {
+2 −2
Original line number Diff line number Diff line
@@ -21,9 +21,9 @@
#include <stdint.h>
#include <sys/types.h>

#include "tinyutils/KeyedVector.h"
#include "tinyutils/Vector.h"
#include "tinyutils/smartpointer.h"
#include "utils/KeyedVector.h"
#include "utils/Vector.h"

#include "ARMAssemblerInterface.h"
#include "CodeCache.h"
Loading