Skip to content

Commit b43c4fb

Browse files
committed
skip invalid a1 load, but not yielding
correctly cherry-picked mcspr/esp8266-Arduino#653ee92eb83e48868960ca0f6c44966dfaa5937d
1 parent 630aa88 commit b43c4fb

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

cores/esp8266/StackThunk.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,17 +179,16 @@ asm(
179179
"movi a2, stack_thunk_save\n\t"
180180
/* But, only when inside of bssl stack (saved a1 != 0) */
181181
"l32i.n a3, a2, 0\n\t"
182-
"beqz a3, stack_thunk_yield_restore\n\t"
182+
"beqz a3, stack_thunk_yield_do_yield\n\t"
183183
"l32i.n a1, a2, 0\n\t"
184184
/* optimistic_yield(10000) without extra l32r */
185+
"stack_thunk_yield_do_yield:\n\t"
185186
"movi a2, 0x10\n\t"
186187
"addmi a2, a2, 0x2700\n\t"
187188
"call0 optimistic_yield\n\t"
188189
/* Swap bearssl <-> cont stacks, again */
189-
"stack_thunk_yield_restore:\n\t"
190190
"movi a2, stack_thunk_yield_save\n\t"
191191
"l32i.n a1, a2, 0\n\t"
192-
"\n"
193192
/* Restore caller */
194193
"l32i.n a0, a1, 12\n\t"
195194
"addi a1, a1, 16\n\t"

0 commit comments

Comments
 (0)