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

Side by Side Diff: src/trap-handler/v8-api.cc

Issue 2371833007: [wasm] Initial signal handler (Closed)
Patch Set: Addressing some of Jochen's feedback Created 3 years, 11 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include <signal.h>
6 #include <stdlib.h>
7
8 #include "include/v8.h"
9 #include "src/trap-handler/trap-handler-internal.h"
10
11 namespace {
12
13 void HandleSignal(int signum, siginfo_t* info, void* arg) {
14 if (!v8::V8::MaybeHandleFault(signum, info, arg)) {
15 abort();
16 }
17 }
18 } // namespace
19
20 namespace v8 {
21
22 bool V8::MaybeHandleFault(int signum, void* info, void* context) {
23 return v8::internal::trap_handler::MaybeHandleFault(signum, info, context);
24 }
25
26 bool V8::RegisterDefaultSignalHandler() {
27 struct sigaction action;
28 action.sa_sigaction = HandleSignal;
29 action.sa_flags = SA_SIGINFO;
30 sigemptyset(&action.sa_mask);
31 return sigaction(SIGSEGV, &action, nullptr) == 0;
32 }
33
34 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698