-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
215 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/src/runtime/interr.c b/src/runtime/interr.c | ||
index 921765171..8da2c6b82 100644 | ||
--- a/src/runtime/interr.c | ||
+++ b/src/runtime/interr.c | ||
@@ -51,7 +51,7 @@ default_lossage_handler(void) | ||
} | ||
exit(1); | ||
} | ||
-static void (*lossage_handler)(void) = default_lossage_handler; | ||
+void (*lossage_handler)(void) = default_lossage_handler; | ||
|
||
#ifdef LISP_FEATURE_WIN32 | ||
static void |
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,13 @@ | ||
diff --git a/src/runtime/interr.c b/src/runtime/interr.c | ||
index 521a8420a..320740f4a 100644 | ||
--- a/src/runtime/interr.c | ||
+++ b/src/runtime/interr.c | ||
@@ -51,7 +51,7 @@ default_lossage_handler(void) | ||
} | ||
exit(1); | ||
} | ||
-static void (*lossage_handler)(void) = default_lossage_handler; | ||
+void (*lossage_handler)(void) = default_lossage_handler; | ||
|
||
#if QSHOW | ||
static void |
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,7 +1,8 @@ | ||
from ctypes import * | ||
import libcalc | ||
import sys | ||
|
||
import libcalc | ||
|
||
def die(msg): | ||
print(msg) | ||
exit(1) | ||
|
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,10 @@ | ||
import sys | ||
|
||
import py_over_so | ||
py_over_so.override_module("libcalc") | ||
import libcalc | ||
|
||
if __name__ == '__main__': | ||
result = libcalc.calc_exhaust_heap() | ||
if result == 2: | ||
print("returned to Python with error code %d after heap exhaustion" % result) |
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,20 @@ | ||
from importlib.abc import MetaPathFinder | ||
from importlib.util import spec_from_file_location | ||
import sys | ||
|
||
|
||
overridden_modules = [] | ||
|
||
|
||
def override_module(name): | ||
global overridden_modules | ||
overridden_modules.append(name) | ||
|
||
|
||
class PyFinder(MetaPathFinder): | ||
def find_spec(self, fullname, path, target=None): | ||
if fullname in overridden_modules: | ||
return spec_from_file_location(fullname, "./%s.py" % fullname) | ||
|
||
|
||
sys.meta_path.insert(0, PyFinder()) |
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
Oops, something went wrong.