Skip to content

Commit 649eeff

Browse files
committed
Only accept PythonBuiltinClassType in HPyRaiseNode.
1 parent 8f614f6 commit 649eeff

File tree

1 file changed

+8
-10
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/hpy

1 file changed

+8
-10
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/hpy/GraalHPyNodes.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -211,32 +211,31 @@ static void setCurrentException(Frame frame, GraalHPyContext nativeContext, PExc
211211
@GenerateUncached
212212
public abstract static class HPyRaiseNode extends Node {
213213

214-
public final int raiseInt(Frame frame, GraalHPyContext nativeContext, int errorValue, Object errType, String format, Object... arguments) {
214+
public final int raiseInt(Frame frame, GraalHPyContext nativeContext, int errorValue, PythonBuiltinClassType errType, String format, Object... arguments) {
215215
return executeInt(frame, nativeContext, errorValue, errType, format, arguments);
216216
}
217217

218-
public final Object raise(Frame frame, GraalHPyContext nativeContext, Object errorValue, Object errType, String format, Object... arguments) {
218+
public final Object raise(Frame frame, GraalHPyContext nativeContext, Object errorValue, PythonBuiltinClassType errType, String format, Object... arguments) {
219219
return execute(frame, nativeContext, errorValue, errType, format, arguments);
220220
}
221221

222-
public final int raiseIntWithoutFrame(GraalHPyContext nativeContext, int errorValue, Object errType, String format, Object... arguments) {
222+
public final int raiseIntWithoutFrame(GraalHPyContext nativeContext, int errorValue, PythonBuiltinClassType errType, String format, Object... arguments) {
223223
return executeInt(null, nativeContext, errorValue, errType, format, arguments);
224224
}
225225

226-
public final Object raiseWithoutFrame(GraalHPyContext nativeContext, Object errorValue, Object errType, String format, Object... arguments) {
226+
public final Object raiseWithoutFrame(GraalHPyContext nativeContext, Object errorValue, PythonBuiltinClassType errType, String format, Object... arguments) {
227227
return execute(null, nativeContext, errorValue, errType, format, arguments);
228228
}
229229

230-
public abstract Object execute(Frame frame, GraalHPyContext nativeContext, Object errorValue, Object errType, String format, Object[] arguments);
230+
public abstract Object execute(Frame frame, GraalHPyContext nativeContext, Object errorValue, PythonBuiltinClassType errType, String format, Object[] arguments);
231231

232-
public abstract int executeInt(Frame frame, GraalHPyContext nativeContext, int errorValue, Object errType, String format, Object[] arguments);
232+
public abstract int executeInt(Frame frame, GraalHPyContext nativeContext, int errorValue, PythonBuiltinClassType errType, String format, Object[] arguments);
233233

234234
@Specialization
235-
static int doInt(Frame frame, GraalHPyContext nativeContext, int errorValue, Object errType, String format, Object[] arguments,
235+
static int doInt(Frame frame, GraalHPyContext nativeContext, int errorValue, PythonBuiltinClassType errType, String format, Object[] arguments,
236236
@Shared("raiseNode") @Cached PRaiseNode raiseNode,
237237
@Shared("transformExceptionToNativeNode") @Cached HPyTransformExceptionToNativeNode transformExceptionToNativeNode) {
238238
try {
239-
// TODO Should properly construct the exception using its constructor
240239
throw raiseNode.execute(raiseNode, errType, PNone.NO_VALUE, format, arguments);
241240
} catch (PException p) {
242241
transformExceptionToNativeNode.execute(frame, nativeContext, p);
@@ -245,11 +244,10 @@ static int doInt(Frame frame, GraalHPyContext nativeContext, int errorValue, Obj
245244
}
246245

247246
@Specialization
248-
static Object doObject(Frame frame, GraalHPyContext nativeContext, Object errorValue, Object errType, String format, Object[] arguments,
247+
static Object doObject(Frame frame, GraalHPyContext nativeContext, Object errorValue, PythonBuiltinClassType errType, String format, Object[] arguments,
249248
@Shared("raiseNode") @Cached PRaiseNode raiseNode,
250249
@Shared("transformExceptionToNativeNode") @Cached HPyTransformExceptionToNativeNode transformExceptionToNativeNode) {
251250
try {
252-
// TODO Should properly construct the exception using its constructor
253251
throw raiseNode.execute(raiseNode, errType, PNone.NO_VALUE, format, arguments);
254252
} catch (PException p) {
255253
transformExceptionToNativeNode.execute(frame, nativeContext, p);

0 commit comments

Comments
 (0)