Commit 0e18e68
buffer: fix writeInt{B,L}E for some neg values
The algorithm used to convert negative values to hex generates incorrect
values when the low byte(s) of the value are zero because a carried
subtraction is applied prematurely.
Fixes: #3992
PR-URL: #3994
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Signed-off-by: Peter A. Bigot <pab@pabigot.com>1 parent 4302648 commit 0e18e68Copy full SHA for 0e18e68
File tree
Expand file treeCollapse file tree
2 files changed
+40
-4
lines changedOpen diff view settings
Filter options
- lib
- test/parallel
Expand file treeCollapse file tree
2 files changed
+40
-4
lines changedOpen diff view settings
Collapse file
+10-4Lines changed: 10 additions & 4 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
939 | 939 | |
940 | 940 | |
941 | 941 | |
942 | | - |
| 942 | + |
943 | 943 | |
944 | | - |
| 944 | + |
| 945 | + |
| 946 | + |
945 | 947 | |
| 948 | + |
946 | 949 | |
947 | 950 | |
948 | 951 | |
| ||
962 | 965 | |
963 | 966 | |
964 | 967 | |
965 | | - |
| 968 | + |
966 | 969 | |
967 | | - |
| 970 | + |
| 971 | + |
| 972 | + |
968 | 973 | |
| 974 | + |
969 | 975 | |
970 | 976 | |
971 | 977 | |
|
Collapse file
test/parallel/test-buffer.js
Copy file name to clipboardExpand all lines: test/parallel/test-buffer.js+30Lines changed: 30 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1027 | 1027 | |
1028 | 1028 | |
1029 | 1029 | |
| 1030 | + |
| 1031 | + |
| 1032 | + |
| 1033 | + |
| 1034 | + |
| 1035 | + |
| 1036 | + |
| 1037 | + |
| 1038 | + |
| 1039 | + |
| 1040 | + |
| 1041 | + |
| 1042 | + |
| 1043 | + |
| 1044 | + |
| 1045 | + |
| 1046 | + |
| 1047 | + |
| 1048 | + |
| 1049 | + |
1030 | 1050 | |
1031 | 1051 | |
1032 | 1052 | |
| ||
1056 | 1076 | |
1057 | 1077 | |
1058 | 1078 | |
| 1079 | + |
| 1080 | + |
| 1081 | + |
| 1082 | + |
| 1083 | + |
| 1084 | + |
| 1085 | + |
| 1086 | + |
| 1087 | + |
| 1088 | + |
1059 | 1089 | |
1060 | 1090 | |
1061 | 1091 | |
|
0 commit comments