Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
4e6bf49a
Kaydet (Commit)
4e6bf49a
authored
Ara 18, 2005
tarafından
Neal Norwitz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Handle more error conditions with SystemError
üst
db83eb31
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
8 deletions
+22
-8
compile.c
Python/compile.c
+22
-8
No files found.
Python/compile.c
Dosyayı görüntüle @
4e6bf49a
...
@@ -2760,8 +2760,7 @@ inplace_binop(struct compiler *c, operator_ty op)
...
@@ -2760,8 +2760,7 @@ inplace_binop(struct compiler *c, operator_ty op)
return
INPLACE_FLOOR_DIVIDE
;
return
INPLACE_FLOOR_DIVIDE
;
}
}
PyErr_Format
(
PyExc_SystemError
,
PyErr_Format
(
PyExc_SystemError
,
"inplace binary op %d should not be possible"
,
"inplace binary op %d should not be possible"
,
op
);
op
);
return
0
;
return
0
;
}
}
...
@@ -2809,6 +2808,9 @@ compiler_nameop(struct compiler *c, identifier name, expr_context_ty ctx)
...
@@ -2809,6 +2808,9 @@ compiler_nameop(struct compiler *c, identifier name, expr_context_ty ctx)
case
GLOBAL_EXPLICIT
:
case
GLOBAL_EXPLICIT
:
optype
=
OP_GLOBAL
;
optype
=
OP_GLOBAL
;
break
;
break
;
default:
/* scope can be 0 */
break
;
}
}
/* XXX Leave assert here, but handle __doc__ and the like better */
/* XXX Leave assert here, but handle __doc__ and the like better */
...
@@ -2830,6 +2832,7 @@ compiler_nameop(struct compiler *c, identifier name, expr_context_ty ctx)
...
@@ -2830,6 +2832,7 @@ compiler_nameop(struct compiler *c, identifier name, expr_context_ty ctx)
Py_DECREF
(
mangled
);
Py_DECREF
(
mangled
);
return
0
;
return
0
;
case
Param
:
case
Param
:
default:
PyErr_SetString
(
PyExc_SystemError
,
PyErr_SetString
(
PyExc_SystemError
,
"param invalid for deref variable"
);
"param invalid for deref variable"
);
return
0
;
return
0
;
...
@@ -2844,6 +2847,7 @@ compiler_nameop(struct compiler *c, identifier name, expr_context_ty ctx)
...
@@ -2844,6 +2847,7 @@ compiler_nameop(struct compiler *c, identifier name, expr_context_ty ctx)
case
AugStore
:
case
AugStore
:
break
;
break
;
case
Param
:
case
Param
:
default:
PyErr_SetString
(
PyExc_SystemError
,
PyErr_SetString
(
PyExc_SystemError
,
"param invalid for local variable"
);
"param invalid for local variable"
);
return
0
;
return
0
;
...
@@ -2860,6 +2864,7 @@ compiler_nameop(struct compiler *c, identifier name, expr_context_ty ctx)
...
@@ -2860,6 +2864,7 @@ compiler_nameop(struct compiler *c, identifier name, expr_context_ty ctx)
case
AugStore
:
case
AugStore
:
break
;
break
;
case
Param
:
case
Param
:
default:
PyErr_SetString
(
PyExc_SystemError
,
PyErr_SetString
(
PyExc_SystemError
,
"param invalid for global variable"
);
"param invalid for global variable"
);
return
0
;
return
0
;
...
@@ -2874,6 +2879,7 @@ compiler_nameop(struct compiler *c, identifier name, expr_context_ty ctx)
...
@@ -2874,6 +2879,7 @@ compiler_nameop(struct compiler *c, identifier name, expr_context_ty ctx)
case
AugStore
:
case
AugStore
:
break
;
break
;
case
Param
:
case
Param
:
default:
PyErr_SetString
(
PyExc_SystemError
,
PyErr_SetString
(
PyExc_SystemError
,
"param invalid for name variable"
);
"param invalid for name variable"
);
return
0
;
return
0
;
...
@@ -3361,6 +3367,7 @@ compiler_visit_expr(struct compiler *c, expr_ty e)
...
@@ -3361,6 +3367,7 @@ compiler_visit_expr(struct compiler *c, expr_ty e)
ADDOP_NAME
(
c
,
DELETE_ATTR
,
e
->
v
.
Attribute
.
attr
,
names
);
ADDOP_NAME
(
c
,
DELETE_ATTR
,
e
->
v
.
Attribute
.
attr
,
names
);
break
;
break
;
case
Param
:
case
Param
:
default:
PyErr_SetString
(
PyExc_SystemError
,
PyErr_SetString
(
PyExc_SystemError
,
"param invalid in attribute expression"
);
"param invalid in attribute expression"
);
return
0
;
return
0
;
...
@@ -3388,6 +3395,7 @@ compiler_visit_expr(struct compiler *c, expr_ty e)
...
@@ -3388,6 +3395,7 @@ compiler_visit_expr(struct compiler *c, expr_ty e)
VISIT_SLICE
(
c
,
e
->
v
.
Subscript
.
slice
,
Del
);
VISIT_SLICE
(
c
,
e
->
v
.
Subscript
.
slice
,
Del
);
break
;
break
;
case
Param
:
case
Param
:
default:
PyErr_SetString
(
PyExc_SystemError
,
PyErr_SetString
(
PyExc_SystemError
,
"param invalid in subscript expression"
);
"param invalid in subscript expression"
);
return
0
;
return
0
;
...
@@ -3441,8 +3449,9 @@ compiler_augassign(struct compiler *c, stmt_ty s)
...
@@ -3441,8 +3449,9 @@ compiler_augassign(struct compiler *c, stmt_ty s)
ADDOP
(
c
,
inplace_binop
(
c
,
s
->
v
.
AugAssign
.
op
));
ADDOP
(
c
,
inplace_binop
(
c
,
s
->
v
.
AugAssign
.
op
));
return
compiler_nameop
(
c
,
e
->
v
.
Name
.
id
,
Store
);
return
compiler_nameop
(
c
,
e
->
v
.
Name
.
id
,
Store
);
default:
default:
fprintf
(
stderr
,
PyErr_Format
(
PyExc_SystemError
,
"invalid node type for augmented assignment
\n
"
);
"invalid node type (%d) for augmented assignment"
,
e
->
kind
);
return
0
;
return
0
;
}
}
return
1
;
return
1
;
...
@@ -3514,9 +3523,9 @@ compiler_handle_subscr(struct compiler *c, const char *kind,
...
@@ -3514,9 +3523,9 @@ compiler_handle_subscr(struct compiler *c, const char *kind,
case
Store
:
op
=
STORE_SUBSCR
;
break
;
case
Store
:
op
=
STORE_SUBSCR
;
break
;
case
Del
:
op
=
DELETE_SUBSCR
;
break
;
case
Del
:
op
=
DELETE_SUBSCR
;
break
;
case
Param
:
case
Param
:
fprintf
(
stder
r
,
PyErr_Format
(
PyExc_SystemErro
r
,
"invalid %s kind %d in subscript
\n
"
,
"invalid %s kind %d in subscript
\n
"
,
kind
,
ctx
);
kind
,
ctx
);
return
0
;
return
0
;
}
}
if
(
ctx
==
AugLoad
)
{
if
(
ctx
==
AugLoad
)
{
...
@@ -3599,6 +3608,7 @@ compiler_simple_slice(struct compiler *c, slice_ty s, expr_context_ty ctx)
...
@@ -3599,6 +3608,7 @@ compiler_simple_slice(struct compiler *c, slice_ty s, expr_context_ty ctx)
case
Store
:
op
=
STORE_SLICE
;
break
;
case
Store
:
op
=
STORE_SLICE
;
break
;
case
Del
:
op
=
DELETE_SLICE
;
break
;
case
Del
:
op
=
DELETE_SLICE
;
break
;
case
Param
:
case
Param
:
default:
PyErr_SetString
(
PyExc_SystemError
,
PyErr_SetString
(
PyExc_SystemError
,
"param invalid in simple slice"
);
"param invalid in simple slice"
);
return
0
;
return
0
;
...
@@ -3618,11 +3628,11 @@ compiler_visit_nested_slice(struct compiler *c, slice_ty s,
...
@@ -3618,11 +3628,11 @@ compiler_visit_nested_slice(struct compiler *c, slice_ty s,
break
;
break
;
case
Slice_kind
:
case
Slice_kind
:
return
compiler_slice
(
c
,
s
,
ctx
);
return
compiler_slice
(
c
,
s
,
ctx
);
break
;
case
Index_kind
:
case
Index_kind
:
VISIT
(
c
,
expr
,
s
->
v
.
Index
.
value
);
VISIT
(
c
,
expr
,
s
->
v
.
Index
.
value
);
break
;
break
;
case
ExtSlice_kind
:
case
ExtSlice_kind
:
default:
PyErr_SetString
(
PyExc_SystemError
,
PyErr_SetString
(
PyExc_SystemError
,
"extended slice invalid in nested slice"
);
"extended slice invalid in nested slice"
);
return
0
;
return
0
;
...
@@ -3664,6 +3674,10 @@ compiler_visit_slice(struct compiler *c, slice_ty s, expr_context_ty ctx)
...
@@ -3664,6 +3674,10 @@ compiler_visit_slice(struct compiler *c, slice_ty s, expr_context_ty ctx)
if
(
ctx
!=
AugStore
)
if
(
ctx
!=
AugStore
)
VISIT
(
c
,
expr
,
s
->
v
.
Index
.
value
);
VISIT
(
c
,
expr
,
s
->
v
.
Index
.
value
);
return
compiler_handle_subscr
(
c
,
"index"
,
ctx
);
return
compiler_handle_subscr
(
c
,
"index"
,
ctx
);
default:
PyErr_Format
(
PyExc_SystemError
,
"invalid slice %d"
,
s
->
kind
);
return
0
;
}
}
return
1
;
return
1
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment