diff --git a/.github/workflows/auto-pr-precise.yml b/.github/workflows/auto-pr-precise.yml index 659933af..b06e5a41 100644 --- a/.github/workflows/auto-pr-precise.yml +++ b/.github/workflows/auto-pr-precise.yml @@ -59,6 +59,7 @@ jobs: git checkout -b ${{steps.create_branch.outputs.PRBRANCH}} echo "TITLE<<__AUTOPR_EOF" >> $GITHUB_OUTPUT git log --format="| %s" ${{ github.event.commits[0].id }}~..${{ github.event.after }} | tr '\n' ' ' >> $GITHUB_OUTPUT + echo "" >> $GITHUB_OUTPUT echo "__AUTOPR_EOF" >> $GITHUB_OUTPUT echo "MESSAGE<<__AUTOPR_EOF" >> $GITHUB_OUTPUT git log --format="> %B" ${{ github.event.commits[0].id }}~..${{ github.event.after }} >> $GITHUB_OUTPUT diff --git a/thread/thread.cpp b/thread/thread.cpp index 9a75fa44..19012261 100644 --- a/thread/thread.cpp +++ b/thread/thread.cpp @@ -753,12 +753,20 @@ R"( DEF_ASM_FUNC(_photon_thread_stub) R"( - call _asan_start - mov 0x40(%rbp), %rdi - movq $0, 0x40(%rbp) - call *0x48(%rbp) - mov %rax, 0x48(%rbp) - mov %rbp, %rdi + mov %rbp, %rbx + xor %rbp, %rbp +)" +#ifdef __SANITIZE_ADDRESS__ +R"( + call _asan_start +)" +#endif +R"( + mov 0x40(%rbx), %rdi + movq %rbp, 0x40(%rbx) + call *0x48(%rbx) + mov %rax, 0x48(%rbx) + mov %rbx, %rdi call _photon_thread_die )" ); @@ -818,7 +826,6 @@ R"( DEF_ASM_FUNC(_photon_thread_stub) R"( - call _asan_start mov 0x40(%rbp), %rcx movq $0, 0x40(%rbp) call *0x48(%rbp) @@ -893,13 +900,21 @@ R"( )" DEF_ASM_FUNC(_photon_thread_stub) +R"( + mov x28, x29 + mov x29, xzr +)" +#ifdef __ADDRESS_SANITIZER__ R"( bl _asan_start //; asan_start() - ldp x0, x1, [x29, #0x40] //; load arg, start into x0, x1 - str xzr, [x29, #0x40] //; set arg as 0 +)" +#endif +R"( + ldp x0, x1, [x28, #0x40] //; load arg, start into x0, x1 + str xzr, [x28, #0x40] //; set arg as 0 blr x1 //; start(x0) - str x0, [x29, #0x48] //; retval = result - mov x0, x29 //; move th to x0 + str x0, [x28, #0x48] //; retval = result + mov x0, x28 //; move th to x0 b _photon_thread_die //; _photon_thread_die(th) )" ); @@ -1284,7 +1299,8 @@ R"( return rq.current->error_number; } - inline void thread_yield_fast() { + __attribute__((noinline)) + void thread_yield_fast() { auto sw = AtomicRunQ().goto_next(); switch_context(sw.from, sw.to); }