It's not a bug. It's a binary truth comparison.
c = 1
a = b = c = d
Let's just break down what we're dealing with here... For starters, there's only one assignment and two comparisons going on here, such as:
a = ((b = c) = d)
Now, if we had an IF statement which looked like IF b = c THEN, would it be TRUE (-1) or FALSE (0)?
b = 0. c = -1. So b = c is FALSE, so it has a value of 0. This simplifies our formula down to:
a = (0 = d)
Now, in this case, d is 0. Since 0 = 0, that's a TRUE statement, which gives a the value of -1.
And that prints your results as expected:
-1, 0, 1, 0