summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-06-24 09:14:02 -0700
committerOri Bernstein <ori@eigenstate.org>2017-06-24 09:14:02 -0700
commit6df66e51fcfa4982eaba21965b8e5a5be5d52575 (patch)
tree7ba8457ddbd1bbbe971ccd2ea293a4f0b0453bf2
parent969945de572d39acd871f2d9371ea81b841c538a (diff)
downloadmc-6df66e51fcfa4982eaba21965b8e5a5be5d52575.tar.gz
Fix uninitialized variable access.
-rw-r--r--lib/std/fmt.myr11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/std/fmt.myr b/lib/std/fmt.myr
index fd57d2d..92782d3 100644
--- a/lib/std/fmt.myr
+++ b/lib/std/fmt.myr
@@ -586,16 +586,17 @@ generic intfmt = {sb, opts, signed, bits : @a::(integral,numeric)
sval = -(bits : int64)
val = (sval : uint64)
isneg = true
+
+ /* if its negative after inverting, we have int64 min */
+ if sval < 0
+ std.sbputs(sb, "-9223372036854775808")
+ -> void
+ ;;
else
val = (bits : uint64)
val &= ~0 >> (8*(sizeof(uint64)-sizeof(@a)))
isneg = false
;;
- /* if its negative after inverting, we have int64 min */
- if sval < 0
- std.sbputs(sb, "-9223372036854775808")
- -> void
- ;;
i = 0
if val == 0