Commit 1a41feb
buffer: don't CHECK on zero-sized realloc
malloc(0) and realloc(ptr, 0) have implementation-defined behavior in
that the standard allows them to either return a unique pointer or a
nullptr for zero-sized allocation requests. Normalize by always using
a nullptr.
Fixes: #3496
PR-URL: #3499
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>1 parent cd83f7e commit 1a41febCopy full SHA for 1a41feb
File tree
Expand file treeCollapse file tree
2 files changed
+24
-9
lines changedOpen diff view settings
Filter options
- src
- test/parallel
Expand file treeCollapse file tree
2 files changed
+24
-9
lines changedOpen diff view settings
Collapse file
+21-9Lines changed: 21 additions & 9 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
211 | 211 | |
212 | 212 | |
213 | 213 | |
214 | | - |
215 | | - |
| 214 | + |
| 215 | + |
| 216 | + |
| 217 | + |
| 218 | + |
| 219 | + |
| 220 | + |
| 221 | + |
| 222 | + |
| 223 | + |
216 | 224 | |
217 | | - |
218 | | - |
| 225 | + |
| 226 | + |
219 | 227 | |
220 | | - |
221 | | - |
| 228 | + |
| 229 | + |
222 | 230 | |
223 | | - |
224 | | - |
225 | | - |
| 231 | + |
| 232 | + |
| 233 | + |
| 234 | + |
| 235 | + |
| 236 | + |
| 237 | + |
226 | 238 | |
227 | 239 | |
228 | 240 | |
|
Collapse file
test/parallel/test-buffer.js
Copy file name to clipboardExpand all lines: test/parallel/test-buffer.js+3Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
550 | 550 | |
551 | 551 | |
552 | 552 | |
| 553 | + |
| 554 | + |
| 555 | + |
553 | 556 | |
554 | 557 | |
555 | 558 | |
|
0 commit comments