I'm afraid that your fix just fixes a sign not the reason of the problem. And I'm afraid that the problem you discovered is complex.
The point is in disabling logging because in that case the error information is not stored in the context. But unfortunately, we apparently have some code (checking the
cond member in
lys_compile_when()) which depends on having error information stored in the context.
I'm not sure about the solution. One option is to avoid the possibility to switch off storing error information in the context. The other option is to avoid using the stored error information inside the library. The second option is probably more challenging, but probably more correct and also follows what we are trying to fulfill in public API - all the functions are supposed to return LY_ERR, other return information are provided via output parameters of the function.
What do you think, ?