Skip to content

Commit 5b74fac

Browse files
various object placement and constness improvements (#7138)
* various object placement and constness improvements * hot fix * function type cast would hide serious UB * reverted to uint8_t * buffer overrun fix * switched from inline to discreate temporary object * readded const * indentation * various constness, control flow, and object placement improvements in freadR * added test as requested * moved test to new location * fixed test * fix-up test --------- Co-authored-by: Michael Chirico <[email protected]>
1 parent a080833 commit 5b74fac

File tree

3 files changed

+210
-141
lines changed

3 files changed

+210
-141
lines changed

inst/tests/tests.Rraw

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21523,3 +21523,9 @@ test(2332.81, {M1[]=frev(M1); M1}, {M2[]=rev(M2); M2})
2152321523

2152421524
# regression test of edge case report #4964
2152521525
test(2333, as.expression(data.table(a = 1))[["a"]], 1)
21526+
21527+
# regression test for hexdigits subscript overrun (uint8_t wraps over 255, unsigned overflow is well defined in c)
21528+
f = tempfile()
21529+
writeLines(c('a', rep('0x1.ffffp0', 10000L), '0x1.ff\x9fp0', rep('0x1.ffffp0', 20000L)), f)
21530+
test(2334, names(fread(f)), "a")
21531+
unlink(f)

0 commit comments

Comments
 (0)