This repository was archived by the owner on Oct 3, 2023. It is now read-only.
Commit db6c507
authored
Fix builds for 32 bit architecture (#15)
* Run tests against 7.1 and 7.0 32 bit architecture.
* Fix segfaults for 32-bit builds.
zend_parse_parameters is not setting optional zval pointers to NULL.
Instead, we need to default the pointer to NULL so we can check for it
and set a default value.
* Fix the generation of span ids to always be positive integers.
php_mt_rand() returns 32 bits of randomness even for 64 bit integers.
In the 64 bit case, a 0 is always right shifted into the 32nd bit.
In the 32 bit case, a right shift is dependent on the compiler
implementation. Generally, negative numbers will remain negative to make
bitshift arthmatic work.
* Fix implicit declaration warnings
* Add comment about why we're casting the php_mt_rand() before bitshifting.
* Fix allocation of default zval for PHP 7.01 parent ef39ce2 commit db6c507
5 files changed
Lines changed: 25 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| |||
250 | 252 | | |
251 | 253 | | |
252 | 254 | | |
253 | | - | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
254 | 262 | | |
255 | 263 | | |
256 | 264 | | |
| |||
519 | 527 | | |
520 | 528 | | |
521 | 529 | | |
522 | | - | |
| 530 | + | |
| 531 | + | |
523 | 532 | | |
524 | 533 | | |
525 | 534 | | |
526 | 535 | | |
527 | 536 | | |
528 | 537 | | |
529 | | - | |
530 | 538 | | |
531 | 539 | | |
532 | 540 | | |
| |||
550 | 558 | | |
551 | 559 | | |
552 | 560 | | |
553 | | - | |
| 561 | + | |
| 562 | + | |
554 | 563 | | |
555 | 564 | | |
556 | 565 | | |
557 | 566 | | |
558 | 567 | | |
559 | 568 | | |
560 | | - | |
561 | 569 | | |
562 | 570 | | |
563 | 571 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
24 | 26 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
0 commit comments