Compare commits

...

6 Commits

Author SHA1 Message Date
BLUELOVETH
e84f86b2de
Merge pull request #349 from lightovernight/fix-pirntchar
fix: ensure isprint() receives unsigned char to prevent MSVC debug as…
2025-03-07 19:11:32 +08:00
BLUELOVETH
71db47bd28
Merge pull request #350 from lightovernight/delete-workflow
Remove redundant CMake setup steps in pybind11 workflow
2025-03-07 19:11:02 +08:00
lightovernight
a26c0ea6be Remove redundant CMake setup steps in pybind11 workflow 2025-03-07 19:05:54 +08:00
lightovernight
d3035c5dd0 fix: ensure isprint() receives unsigned char to prevent MSVC debug assertions 2025-03-07 18:38:03 +08:00
BLUELOVETH
1d73bdf241
Merge pull request #348 from lightovernight/fix-lineno
Fix line number reporting in trace functions for function calls
2025-03-07 18:17:14 +08:00
lightovernight
e2a632dc72 Improve Frame line number retrieval logic 2025-03-07 17:51:49 +08:00
3 changed files with 6 additions and 12 deletions

View File

@ -24,9 +24,6 @@ jobs:
sudo apt-get update
sudo apt-get install -y gcc g++
- name: Set up CMake
uses: jwlawson/actions-setup-cmake@v1.10
- name: Test
run: |
cd include/pybind11/tests
@ -43,9 +40,6 @@ jobs:
- name: Set up MSVC
uses: ilammy/msvc-dev-cmd@v1
- name: Set up CMake
uses: jwlawson/actions-setup-cmake@v1.10
- name: Test
run: |
cd include\pybind11\tests
@ -65,9 +59,6 @@ jobs:
echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
- name: Set up CMake
uses: jwlawson/actions-setup-cmake@v1.10
- name: Test
run: |
cd include/pybind11/tests

View File

@ -103,7 +103,7 @@ void c11_sbuf__write_quoted(c11_sbuf* self, c11_sv sv, char quote) {
if(i + u8bytes > sv.size) u8bytes = 0; // invalid utf8
if(u8bytes <= 1) {
// not a valid utf8 char, or ascii
if(!isprint(c)) {
if(!isprint((unsigned char)c)) {
unsigned char uc = (unsigned char)c;
c11_sbuf__write_cstrn(self, "\\x", 2);
c11_sbuf__write_char(self, PK_HEX_TABLE[uc >> 4]);

View File

@ -121,8 +121,11 @@ void Frame__gc_mark(py_Frame* self) {
int Frame__lineno(const py_Frame* self) {
int ip = self->ip;
if(ip < 0) return 0;
if(ip >= 0)
return c11__getitem(BytecodeEx, &self->co->codes_ex, ip).lineno;
if(!self->is_locals_special)
return self->co->start_line;
return 0;
}
int Frame__iblock(const py_Frame* self) {