View Issue Details

IDProjectCategoryView StatusLast Update
0031158RunnerFunctionsPublic2019-07-12 11:21
ReporterYellowAfterlifeAssigned ToRussell Kay 
PriorityLowSeverityC - GeneralReproducibility100%
Status ResolvedResolutionFixed 
PlatformWindowsOSWindows 10 ProOS Version>=1703
Product Version 
Target VersionFixed in Version 
Summary0031158: Functions: resizing+externally modifying a buffer won't change the "available bytes" counter
DescriptionAnd thus trying to read a string from the buffer will cut at pre-resize boundary
var f = external_define("a_bug_dll.dll", "buffer_strcpy", dll_cdecl, ty_real, 2, ty_string, ty_string);
var b = buffer_create(12, buffer_grow, 1);
buffer_resize(b, 50);
external_call(f, buffer_get_address(b), "It would seem like there's a bug.");
buffer_seek(b, buffer_seek_start, 0);
show_debug_message(buffer_read(b, buffer_string)); // `It would see`
// now watch this:
buffer_poke(b, buffer_get_size(b) - 1, buffer_u8, 0);
buffer_seek(b, buffer_seek_start, 0);
show_debug_message(buffer_read(b, buffer_string)); // `It would seem like there's a bug.`
TagsBuffer, functions, Runner
1.4 Found In
2.x Runtime Found In9.9.1.1497
2.x Runtime Verified In

Activities

YellowAfterlife

2019-07-10 11:55

Developer  

buffer_available_bytes_after_external_change.yyz (60,034 bytes)

Russell Kay

2019-07-12 11:21

Manager   ~0064408

Fixed in gitlab