@@ -98,6 +98,22 @@ diff -rupNw glucose-syrup/mtl/Vec.h glucose-syrup-patched/mtl/Vec.h
98
98
throw OutOfMemoryException();
99
99
}
100
100
101
+ diff -rupNw glucose-syrup/mtl/Vec.h glucose-syrup-patched/mtl/Vec.h
102
+ --- glucose-syrup/mtl/Vec.h
103
+ +++ glucose-syrup-patched/mtl/Vec.h
104
+ @@ -103,8 +103,10 @@
105
+ void vec<T>::capacity(int min_cap) {
106
+ if (cap >= min_cap) return;
107
+ int add = imax((min_cap - cap + 1) & ~1, ((cap >> 1) + 2) & ~1); // NOTE: grow by approximately 3/2
108
+ - if (add > INT_MAX - cap || (((data = (T*)::realloc(data, (cap += add) * sizeof(T))) == NULL) && errno == ENOMEM))
109
+ - throw OutOfMemoryException();
110
+ + if (add > INT_MAX - cap)
111
+ + throw OutOfMemoryException();
112
+ +
113
+ + data = (T*)xrealloc(data, (cap += add) * sizeof(T));
114
+ }
115
+
116
+
101
117
diff -rupNw glucose-syrup/simp/SimpSolver.cc glucose-syrup-patched/simp/SimpSolver.cc
102
118
--- glucose-syrup/simp/SimpSolver.cc 2014-10-03 11:10:22.000000000 +0200
103
119
+++ glucose-syrup-patched/simp/SimpSolver.cc 2018-04-21 16:58:22.950005391 +0200
@@ -201,6 +217,15 @@ diff -rupNw glucose-syrup/utils/ParseUtils.h glucose-syrup-patched/utils/ParseUt
201
217
202
218
int operator * () const { return (pos >= size) ? EOF : buf[pos]; }
203
219
void operator ++ () { pos++; assureLookahead(); }
220
+ @@ -96,7 +96,7 @@
221
+ if (*in != '.') printf("PARSE ERROR! Unexpected char: %c\n", *in),exit(3);
222
+ ++in; // skip dot
223
+ currentExponent = 0.1;
224
+ - while (*in >= '0' && *in <= '9')
225
+ + while (*in >= '0' && *in <= '9')
226
+ accu = accu + currentExponent * ((double)(*in - '0')),
227
+ currentExponent /= 10,
228
+ ++in;
204
229
diff -rupNw glucose-syrup/utils/System.h glucose-syrup-patched/utils/System.h
205
230
--- glucose-syrup/utils/System.h 2014-10-03 11:10:22.000000000 +0200
206
231
+++ glucose-syrup-patched/utils/System.h 2018-04-21 16:58:22.950005391 +0200
0 commit comments