https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106973

Arsen Arsenović <arsen at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |arsen at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |arsen at gcc dot gnu.org
             Status|NEW                         |ASSIGNED

--- Comment #8 from Arsen Arsenović <arsen at gcc dot gnu.org> ---
I've a WIP fix locally for the ICE (currently undergoing reg-testing).  I doubt
that setjmp can be used reliably in a coroutine, but, technically, I suspect
it'll work if usual setjmp rules are respected (so, no returning, suspending -
which involves returning, etc).  I haven't tested that much, just the ICE.

(In reply to Hui Peng Hu from comment #7)
> I was trying to call libjpeg to decode images inside a generator. A snippet
> of code that I found online used setjmp/longjmp for error handling, hence I
> ran into this issue. Given that the longjmp is called while the coroutine is
> executing, I'd imagine that the behavior is fairly well-defined.

the standard is fairly absolute in this regard: setjmp/longjmp are UB in
suspension contexts ( https://eel.is/c++draft/csetjmp.syn#2.sentence-3 )

Reply via email to