From 8edac9cf1d8a052b306e43ba92b3a91f51a221be Mon Sep 17 00:00:00 2001 From: alaviss Date: Mon, 8 Jun 2020 01:15:10 -0500 Subject: [PATCH] openssl: use explicit result for SSL_in_init (#14597) Sometimes the analysis might get funky and decide that the if-expression below is not an if-expression. Details of how this can happen is largely unknown, but it's easy to prevent so we will just go forward with that. Fix #14591 --- lib/wrappers/openssl.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/wrappers/openssl.nim b/lib/wrappers/openssl.nim index b7f18ad798..bea96127d2 100644 --- a/lib/wrappers/openssl.nim +++ b/lib/wrappers/openssl.nim @@ -418,9 +418,9 @@ else: sslState {.global.} = cast[proc(ssl: SslPtr): cint {.cdecl, gcsafe.}](sslSymNullable("SSL_state")) if not theProc.isNil: - theProc(ssl) + result = theProc(ssl) elif not sslState.isNil: - sslState(ssl) and SSL_ST_INIT + result = sslState(ssl) and SSL_ST_INIT else: raiseInvalidLibrary MainProc