Re:Zcoin implementation bug enabled attacker to create over ...
by steveklabnik on Tuesday March 07, 2017 @11:52AM
(#13811960)
No, as assignment always results in (), and if always requires a boolean. This is by design.
[ Parent
| on HN ]
Re:Zcoin implementation bug enabled attacker to create over ...
by tyingq on Tuesday March 07, 2017 @12:27PM
(#13812423)
Ah...so this works:
fn main() {
let mut x = false;
println!("{}", x);
if {x=true;x} {
println!("{}", x);
}
}
But stands out as pretty obvious. Not something you might easily sneak into a codebase.
Re:Zcoin implementation bug enabled attacker to create over ...
by steveklabnik on Tuesday March 07, 2017 @12:51PM
(#13812736)
Sneaky! Yeah, no way this should get past code review, and not even easy to accidentally type.