fix empty function name handling

This commit is contained in:
方而静 2024-06-11 17:45:31 +08:00
parent afd0cbc8a0
commit a9376bd80f
2 changed files with 2 additions and 1 deletions

1
.gitignore vendored
View File

@ -33,3 +33,4 @@ main.dSYM/
docs/references.md docs/references.md
.xmake .xmake
.vs

View File

@ -70,7 +70,7 @@ struct SourceData {
} }
Str snapshot(int lineno, const char* cursor, std::string_view name) const { Str snapshot(int lineno, const char* cursor, std::string_view name) const {
return pkpy_SourceData__snapshot(self, lineno, cursor, name.data()); return pkpy_SourceData__snapshot(self, lineno, cursor, name.empty() ? nullptr : name.data());
} }
~SourceData() { ~SourceData() {