summaryrefslogtreecommitdiffstats
path: root/runtime/mirror/art_method.cc
diff options
context:
space:
mode:
authorDave Allison <dallison@google.com>2014-08-14 00:01:12 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-08-12 19:23:43 +0000
commitb74ff132f217776c1ab698712bc2dbc526297288 (patch)
tree86da3e98cbd942bb4c2fda6f0f50fd44c1c0a101 /runtime/mirror/art_method.cc
parent826f1038187e00399a8c6e0044ad0ea29c0ba000 (diff)
parent648d7112609dd19c38131b3e71c37bcbbd19d11e (diff)
downloadart-b74ff132f217776c1ab698712bc2dbc526297288.zip
art-b74ff132f217776c1ab698712bc2dbc526297288.tar.gz
art-b74ff132f217776c1ab698712bc2dbc526297288.tar.bz2
Merge "Reduce stack usage for overflow checks"
Diffstat (limited to 'runtime/mirror/art_method.cc')
-rw-r--r--runtime/mirror/art_method.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/runtime/mirror/art_method.cc b/runtime/mirror/art_method.cc
index e88a390..370bfb9 100644
--- a/runtime/mirror/art_method.cc
+++ b/runtime/mirror/art_method.cc
@@ -283,6 +283,11 @@ uint32_t ArtMethod::FindCatchBlock(Handle<ArtMethod> h_this, Handle<Class> excep
void ArtMethod::Invoke(Thread* self, uint32_t* args, uint32_t args_size, JValue* result,
const char* shorty) {
+ if (UNLIKELY(__builtin_frame_address(0) < self->GetStackEnd())) {
+ ThrowStackOverflowError(self);
+ return;
+ }
+
if (kIsDebugBuild) {
self->AssertThreadSuspensionIsAllowable();
CHECK_EQ(kRunnable, self->GetState());