]> granicus.if.org Git - python/commitdiff
DELETE_FAST should issue an exception when the local variable is undefined.
authorGuido van Rossum <guido@python.org>
Tue, 12 May 1998 20:27:36 +0000 (20:27 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 12 May 1998 20:27:36 +0000 (20:27 +0000)
Python/ceval.c

index 05275373cdf1efe19b8d9d022e486c10a717cbc8..7c358dbd934631faedd7dfad6f979b4a25ed0688 100644 (file)
@@ -1337,6 +1337,13 @@ eval_code2(co, globals, locals,
                        continue;
 
                case DELETE_FAST:
+                       x = GETLOCAL(oparg);
+                       if (x == NULL) {
+                               PyErr_SetObject(PyExc_NameError,
+                                          PyTuple_GetItem(co->co_varnames,
+                                                       oparg));
+                               break;
+                       }
                        SETLOCAL(oparg, NULL);
                        continue;