gh-104686: Fix tracing for decorated classes (#104708)

This commit is contained in:
Jelle Zijlstra 2023-05-21 16:20:19 -07:00 committed by GitHub
parent 64d1b44a54
commit cd9748409a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 50 additions and 0 deletions

View file

@ -2486,6 +2486,10 @@ compiler_class_body(struct compiler *c, stmt_ty s, int firstlineno)
}
/* 2. load the 'build_class' function */
// these instructions should be attributed to the class line,
// not a decorator line
loc = LOC(s);
ADDOP(c, loc, PUSH_NULL);
ADDOP(c, loc, LOAD_BUILD_CLASS);