# HG changeset patch # User Michael Pavone # Date 1428294889 25200 # Node ID 7279e21dad6893b19747ad2df55f12fa258e891d # Parent 74cab9b5f2a484c9608d27f1955b24ed11e6303b Fix internal variable name generation for certain float values diff -r 74cab9b5f2a4 -r 7279e21dad68 cbackend.js --- a/cbackend.js Sat Apr 04 12:34:43 2015 -0700 +++ b/cbackend.js Sun Apr 05 21:34:49 2015 -0700 @@ -165,7 +165,7 @@ floatlit.prototype.toC = function() { var floatType = this.bits == 32 ? 'float' : 'double'; - var str = floatType + '_' + (this.val < 0 ? 'neg_' + (0-this.val).toString() : this.val.toString()).replace('.', '_'); + var str = floatType + '_' + (this.val < 0 ? 'neg_' + (0-this.val).toString() : this.val.toString()).replace('.', '_').replace('-', 'neg'); if (!(str in declaredInts)) { toplevelcode += 'obj_float' + this.bits + ' ' + str + ' = {{&obj_float' + this.bits + '_meta, NULL}, ' + this.val.toString() + '};\n'; declaredInts[str] = true;