Issue #9128: Fix validation of class decorators in parser module.
diff --git a/Lib/test/test_parser.py b/Lib/test/test_parser.py
index ca5f43f..85e39c7 100644
--- a/Lib/test/test_parser.py
+++ b/Lib/test/test_parser.py
@@ -156,6 +156,14 @@
 
     def test_class_defs(self):
         self.check_suite("class foo():pass")
+        self.check_suite("@class_decorator\n"
+                         "class foo():pass")
+        self.check_suite("@class_decorator(arg)\n"
+                         "class foo():pass")
+        self.check_suite("@decorator1\n"
+                         "@decorator2\n"
+                         "class foo():pass")
+
 
     def test_import_from_statement(self):
         self.check_suite("from sys.path import *")
diff --git a/Misc/NEWS b/Misc/NEWS
index cc5ba32..f605050 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -81,6 +81,8 @@
 Library
 -------
 
+- Issue #9128: Fix validation of class decorators in parser module.
+
 - Issue #7673: Fix security vulnerability (CVE-2010-2089) in the audioop
   module, ensure that the input string length is a multiple of the frame size
 
diff --git a/Modules/parsermodule.c b/Modules/parsermodule.c
index 365ec90..097c450 100644
--- a/Modules/parsermodule.c
+++ b/Modules/parsermodule.c
@@ -2679,14 +2679,15 @@
 static int
 validate_decorated(node *tree)
 {
-  int nch = NCH(tree);
-  int ok = (validate_ntype(tree, decorated)
-            && (nch == 2)
-            && validate_decorators(RCHILD(tree, -2))
-            && (validate_funcdef(RCHILD(tree, -1))
-                || validate_class(RCHILD(tree, -1)))
-            );
-  return ok;
+    int nch = NCH(tree);
+    int ok = (validate_ntype(tree, decorated)
+              && (nch == 2)
+              && validate_decorators(RCHILD(tree, -2)));
+    if (TYPE(RCHILD(tree, -1)) == funcdef)
+        ok = ok && validate_funcdef(RCHILD(tree, -1));
+    else
+        ok = ok && validate_class(RCHILD(tree, -1));
+    return ok;
 }
 
 static int