From 368dd377989a07862be20f87c23329734b2277d8 Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Sat, 18 Oct 2014 19:55:44 +0200 Subject: [PATCH] runtime_loader: Fix missing include of util/kernel_cpp.h. Due to the missing include, the builtin new and delete operators were used in those two files instead of the ones from the include used everywhere else in the runtime_loader. --- src/system/runtime_loader/elf_tls.cpp | 8 +++++++- src/system/runtime_loader/images.cpp | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/system/runtime_loader/elf_tls.cpp b/src/system/runtime_loader/elf_tls.cpp index 40bc66c006..f534cecc00 100644 --- a/src/system/runtime_loader/elf_tls.cpp +++ b/src/system/runtime_loader/elf_tls.cpp @@ -12,6 +12,8 @@ #include +#include + class TLSBlock { public: @@ -284,8 +286,12 @@ DynamicThreadVector::_ResizeVector(unsigned minimumSize) *fVector = (TLSBlock*)newVector; memset(*fVector + oldSize + 1, 0, (size - oldSize) * sizeof(TLSBlock)); - if (fGeneration == NULL) + if (fGeneration == NULL) { fGeneration = new Generation; + if (fGeneration == NULL) + return B_NO_MEMORY; + } + *(Generation**)*fVector = fGeneration; fGeneration->SetSize(size); diff --git a/src/system/runtime_loader/images.cpp b/src/system/runtime_loader/images.cpp index 15f39d280a..d851f9fd06 100644 --- a/src/system/runtime_loader/images.cpp +++ b/src/system/runtime_loader/images.cpp @@ -23,6 +23,8 @@ #include "elf_tls.h" #include "runtime_loader_private.h" +#include + // keep in sync with app ldscript #ifdef __x86_64__