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

Unified Diff: src/snapshot/serializer-common.cc

Issue 2428463002: [serializer] add test case for unknown external references. (Closed)
Patch Set: fix 2 Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/cctest/cctest.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/snapshot/serializer-common.cc
diff --git a/src/snapshot/serializer-common.cc b/src/snapshot/serializer-common.cc
index baab8f3d6b26aca39cd98688b0d83def58ba0c0f..6c400cd25ea2c9dfe1cd08a0c6bdf486e2bc8666 100644
--- a/src/snapshot/serializer-common.cc
+++ b/src/snapshot/serializer-common.cc
@@ -8,6 +8,10 @@
#include "src/ic/stub-cache.h"
#include "src/list-inl.h"
+#if defined(DEBUG) && defined(V8_OS_LINUX)
+#include <execinfo.h>
+#endif // DEBUG && V8_OS_LINUX
+
namespace v8 {
namespace internal {
@@ -33,7 +37,14 @@ uint32_t ExternalReferenceEncoder::Encode(Address address) const {
DCHECK_NOT_NULL(address);
base::HashMap::Entry* entry =
const_cast<base::HashMap*>(map_)->Lookup(address, Hash(address));
- DCHECK_NOT_NULL(entry);
+ if (entry == nullptr) {
+ void* function_addr = address;
+ v8::base::OS::PrintError("Unknown external reference %p.\n", function_addr);
+#if defined(DEBUG) && defined(V8_OS_LINUX)
+ v8::base::OS::PrintError("%s\n", backtrace_symbols(&function_addr, 1)[0]);
+#endif // DEBUG && V8_OS_LINUX
+ v8::base::OS::Abort();
+ }
return static_cast<uint32_t>(reinterpret_cast<intptr_t>(entry->value));
}
« no previous file with comments | « no previous file | test/cctest/cctest.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698