PeachCompiler icon indicating copy to clipboard operation
PeachCompiler copied to clipboard

Bug in the codegenerator in funciton: bool codegen_response_acknowledged(struct response* res)

Open fedi-nabli opened this issue 2 years ago • 2 comments

Hello Daniel, I wanted to point out, that in the codegen_response_acknowledged function, I found a BUG; If we're checking the flags we should type type:

bool codegen_response_acknowledged(struct response* res)
{
  return res && res->flags & RESPONSE_FLAG_ACKNOWLEDGED;
}

(the double && should be & in the flags) instead of:

bool codegen_response_acknowledged(struct response* res)
{
  return res && res->flags && RESPONSE_FLAG_ACKNOWLEDGED;
}

thank you

fedi-nabli avatar Aug 05 '23 15:08 fedi-nabli

Thank you for bringing this to my attention you are correct this should be a bitwise AND not a logical AND

nibblebits avatar Aug 05 '23 16:08 nibblebits

Hello, Thanks for reaching out, once theres enough issue reports I will go through them all and create a lecture addressing any issues.

Thanks Dan

nibblebits avatar Nov 20 '24 19:11 nibblebits