mirror of
https://github.com/dart-lang/sdk
synced 2024-09-19 20:51:50 +00:00
14db718ed5
Mostly tests; 1 non-test bug in propagating an error through Dart_SetReturnValue. This is progress towards asserting thread->excution_state() == kThreadInVM in Object::Allocate. Change-Id: I6a59549868ab317b3c0d32aa42f3661289cbf456 Reviewed-on: https://dart-review.googlesource.com/71720 Reviewed-by: Siva Annamalai <asiva@google.com> Reviewed-by: Ben Konyi <bkonyi@google.com> Commit-Queue: Ryan Macnak <rmacnak@google.com>
31 lines
815 B
C++
31 lines
815 B
C++
// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
#include "vm/longjump.h"
|
|
#include "vm/thread.h"
|
|
#include "vm/unit_test.h"
|
|
|
|
namespace dart {
|
|
|
|
static void LongJumpHelper(LongJumpScope* jump) {
|
|
const Error& error = Error::Handle(
|
|
LanguageError::New(String::Handle(String::New("LongJumpHelper"))));
|
|
jump->Jump(1, error);
|
|
UNREACHABLE();
|
|
}
|
|
|
|
ISOLATE_UNIT_TEST_CASE(LongJump) {
|
|
LongJumpScope* base = Thread::Current()->long_jump_base();
|
|
{
|
|
LongJumpScope jump;
|
|
if (setjmp(*jump.Set()) == 0) {
|
|
LongJumpHelper(&jump);
|
|
UNREACHABLE();
|
|
}
|
|
}
|
|
ASSERT(base == Thread::Current()->long_jump_base());
|
|
}
|
|
|
|
} // namespace dart
|