Skip to content

Commit 2b70409

Browse files
committed
Add assert statements
1 parent 9c8e061 commit 2b70409

4 files changed

Lines changed: 16 additions & 0 deletions

File tree

src/e_j0.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
* ====================================================
1212
*/
1313

14+
#include <assert.h>
15+
1416
#include "cdefs-compat.h"
1517
//__FBSDID("$FreeBSD: src/lib/msun/src/e_j0.c,v 1.9 2008/02/22 02:30:35 das Exp $");
1618

@@ -276,6 +278,7 @@ static const double pS2[5] = {
276278
int32_t ix;
277279
GET_HIGH_WORD(ix,x);
278280
ix &= 0x7fffffff;
281+
assert(ix>=0x40000000 && ix<=0x48000000);
279282
if(ix>=0x40200000) {p = pR8; q= pS8;}
280283
else if(ix>=0x40122E8B){p = pR5; q= pS5;}
281284
else if(ix>=0x4006DB6D){p = pR3; q= pS3;}
@@ -372,6 +375,7 @@ static const double qS2[6] = {
372375
int32_t ix;
373376
GET_HIGH_WORD(ix,x);
374377
ix &= 0x7fffffff;
378+
assert(ix>=0x40000000 && ix<=0x48000000);
375379
if(ix>=0x40200000) {p = qR8; q= qS8;}
376380
else if(ix>=0x40122E8B){p = qR5; q= qS5;}
377381
else if(ix>=0x4006DB6D){p = qR3; q= qS3;}

src/e_j0f.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
* ====================================================
1414
*/
1515

16+
#include <assert.h>
17+
1618
#include "cdefs-compat.h"
1719
//__FBSDID("$FreeBSD: src/lib/msun/src/e_j0f.c,v 1.8 2008/02/22 02:30:35 das Exp $");
1820

@@ -232,6 +234,7 @@ static const float pS2[5] = {
232234
int32_t ix;
233235
GET_FLOAT_WORD(ix,x);
234236
ix &= 0x7fffffff;
237+
assert(ix>=0x40000000 && ix<=0x48000000);
235238
if(ix>=0x41000000) {p = pR8; q= pS8;}
236239
else if(ix>=0x40f71c58){p = pR5; q= pS5;}
237240
else if(ix>=0x4036db68){p = pR3; q= pS3;}
@@ -328,6 +331,7 @@ static const float qS2[6] = {
328331
int32_t ix;
329332
GET_FLOAT_WORD(ix,x);
330333
ix &= 0x7fffffff;
334+
assert(ix>=0x40000000 && ix<=0x48000000);
331335
if(ix>=0x41000000) {p = qR8; q= qS8;}
332336
else if(ix>=0x40f71c58){p = qR5; q= qS5;}
333337
else if(ix>=0x4036db68){p = qR3; q= qS3;}

src/e_j1.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
* ====================================================
1212
*/
1313

14+
#include <assert.h>
15+
1416
#include "cdefs-compat.h"
1517
//__FBSDID("$FreeBSD: src/lib/msun/src/e_j1.c,v 1.9 2008/02/22 02:30:35 das Exp $");
1618

@@ -270,6 +272,7 @@ static const double ps2[5] = {
270272
int32_t ix;
271273
GET_HIGH_WORD(ix,x);
272274
ix &= 0x7fffffff;
275+
assert(ix>=0x40000000 && ix<=0x48000000);
273276
if(ix>=0x40200000) {p = pr8; q= ps8;}
274277
else if(ix>=0x40122E8B){p = pr5; q= ps5;}
275278
else if(ix>=0x4006DB6D){p = pr3; q= ps3;}
@@ -367,6 +370,7 @@ static const double qs2[6] = {
367370
int32_t ix;
368371
GET_HIGH_WORD(ix,x);
369372
ix &= 0x7fffffff;
373+
assert(ix>=0x40000000 && ix<=0x48000000);
370374
if(ix>=0x40200000) {p = qr8; q= qs8;}
371375
else if(ix>=0x40122E8B){p = qr5; q= qs5;}
372376
else if(ix>=0x4006DB6D){p = qr3; q= qs3;}

src/e_j1f.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
* ====================================================
1414
*/
1515

16+
#include <assert.h>
17+
1618
#include "cdefs-compat.h"
1719
//__FBSDID("$FreeBSD: src/lib/msun/src/e_j1f.c,v 1.8 2008/02/22 02:30:35 das Exp $");
1820

@@ -227,6 +229,7 @@ static const float ps2[5] = {
227229
int32_t ix;
228230
GET_FLOAT_WORD(ix,x);
229231
ix &= 0x7fffffff;
232+
assert(ix>=0x40000000 && ix<=0x48000000);
230233
if(ix>=0x41000000) {p = pr8; q= ps8;}
231234
else if(ix>=0x40f71c58){p = pr5; q= ps5;}
232235
else if(ix>=0x4036db68){p = pr3; q= ps3;}
@@ -324,6 +327,7 @@ static const float qs2[6] = {
324327
int32_t ix;
325328
GET_FLOAT_WORD(ix,x);
326329
ix &= 0x7fffffff;
330+
assert(ix>=0x40000000 && ix<=0x48000000);
327331
if(ix>=0x40200000) {p = qr8; q= qs8;}
328332
else if(ix>=0x40f71c58){p = qr5; q= qs5;}
329333
else if(ix>=0x4036db68){p = qr3; q= qs3;}

0 commit comments

Comments
 (0)