Skip to content

Commit fc2abf4

Browse files
committed
Merge remote-tracking branch 'origin/fa/numpy-building' into tim/numpy-building
2 parents 6a17f99 + 788106d commit fc2abf4

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

graalpython/com.oracle.graal.python.cext/src/longobject.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ long PyLong_AsLongAndOverflow(PyObject *obj, int *overflow) {
5252
return -1;
5353
}
5454
long result = truffle_invoke_l(PY_TRUFFLE_CEXT, "PyLong_AsPrimitive", to_java(obj), true, sizeof(long), truffle_read_string("long"));
55-
*overflow = result == -1L && PyErr_Occurred();
55+
*overflow = result == -1L && PyErr_Occurred() != NULL;
5656
return result;
5757
}
5858

@@ -93,8 +93,13 @@ PyObject * PyLong_FromVoidPtr(void *p) {
9393
void * PyLong_AsVoidPtr(PyObject *obj){
9494
return (void *)PyLong_AsSsize_t(obj);
9595
}
96+
9697
PyObject * PyLong_FromLong(long n) {
97-
return PyLong_FromUnsignedLongLong(n);
98+
void *result = polyglot_invoke(PY_TRUFFLE_CEXT, "PyLong_FromLongLong", n, true);
99+
if (result == ERROR_MARKER) {
100+
return NULL;
101+
}
102+
return to_sulong(result);
98103
}
99104

100105
PyObject * PyLong_FromLongLong(long long n) {

graalpython/com.oracle.graal.python.test/src/tests/cpyext/test_capsule.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def compile_module(self, name):
5656
''',
5757
resultspec="i",
5858
argspec='sn',
59-
arguments=["PyObject* name", "Py_ssize_t ptr"],
59+
arguments=["char* name", "Py_ssize_t ptr"],
6060
callfunction="wrap_PyCapsule_Check",
6161
cmpfunc=unhandled_error_compare
6262
)

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/frame/FrameBuiltins.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ public Object clear(PFrame self, int idx) {
8383
@GenerateNodeFactory
8484
public abstract static class TruffleGetClassScopeNode extends PythonBuiltinNode {
8585
@Specialization
86+
@TruffleBoundary
8687
public Object add(PFrame self) {
8788
// TODO: remove me
8889
// TODO: do it properly via the python API in super.__init__ :

0 commit comments

Comments
 (0)