Skip to content

Commit fab1336

Browse files
committed
Add missing fallback
1 parent 13d0a76 commit fab1336

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/cext/PythonCextUnicodeBuiltins.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ public static _PyUnicode_AsUTF8String create() {
875875
abstract static class PyTruffle_Unicode_AsUTF8AndSize_CharPtr extends CApiUnaryBuiltinNode {
876876

877877
@Specialization
878-
Object doUnicode(PString s,
878+
static Object doUnicode(PString s,
879879
@Bind("this") Node inliningTarget,
880880
@Cached InlinedConditionProfile profile,
881881
@Cached _PyUnicode_AsUTF8String asUTF8String) {
@@ -885,6 +885,11 @@ Object doUnicode(PString s,
885885
}
886886
return new PySequenceArrayWrapper(s.getUtf8Bytes(), 1);
887887
}
888+
889+
@Fallback
890+
Object doError(@SuppressWarnings("unused") Object s) {
891+
throw raise(TypeError, BAD_ARG_TYPE_FOR_BUILTIN_OP);
892+
}
888893
}
889894

890895
@CApiBuiltin(ret = Py_ssize_t, args = {PyObject}, call = Direct)
@@ -912,6 +917,11 @@ Object doUnicode(PString s,
912917
}
913918
return new PySequenceArrayWrapper(s.getWCharBytes(), 1);
914919
}
920+
921+
@Fallback
922+
Object doError(@SuppressWarnings("unused") Object s) {
923+
throw raise(TypeError, BAD_ARG_TYPE_FOR_BUILTIN_OP);
924+
}
915925
}
916926

917927
@CApiBuiltin(ret = Py_ssize_t, args = {PyObject}, call = Direct)

0 commit comments

Comments
 (0)