Move birthday for exception objects to the start of the except block

This commit is contained in:
K. Lange 2021-03-11 13:57:11 +09:00
parent 63d7c8af97
commit 1201dc8115

View File

@ -1629,6 +1629,7 @@ static void tryStatement() {
current->locals[exceptionObject].name = syntheticToken("exception");
}
/* Make sure we update the local name for debugging */
current->function->localNames[localNameCount].birthday = currentChunk()->count;
current->function->localNames[localNameCount].name = krk_copyString(current->locals[exceptionObject].name.start, current->locals[exceptionObject].name.length);
consume(TOKEN_COLON, "Expect ':' after except.");