forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Exception handling and test for divide by zero exception. (#29)
* Add Exception handling and test for divide by zero exception.
- Loading branch information
Showing
8 changed files
with
12,039 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
NO_CONTEXT = true | ||
|
||
all: logging.wasm bad_signature.wasm | ||
all: logging.wasm bad_signature.wasm segv.wasm | ||
|
||
include ../../../../api/wasm/cpp/Makefile.base |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// NOLINT(namespace-envoy) | ||
#include <string> | ||
|
||
#include "proxy_wasm_intrinsics.h" | ||
|
||
static int* badptr = nullptr; | ||
|
||
extern "C" EMSCRIPTEN_KEEPALIVE void proxy_onStart() { | ||
logError("before badptr"); | ||
*badptr = 1; | ||
logError("after badptr"); | ||
} | ||
|
||
extern "C" EMSCRIPTEN_KEEPALIVE void proxy_onLog(uint32_t context_id) { | ||
logError("before div by zero"); | ||
logError("divide by zero: " + std::to_string(100 / context_id)); | ||
logError("after div by zero"); | ||
} |
Binary file not shown.
Oops, something went wrong.