mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
mruby-io: fix incorrect pointer access in io.c
In the Windows-specific code path for IO.popen, the variable 'p' is a struct, not a pointer. The code was using 'p->klass' to access a member, which is incorrect and causes a build failure on Windows. This has been corrected to use the 'klass' argument directly. Co-authored-by: Gemini <gemini@google.com>
This commit is contained in:
@@ -468,7 +468,7 @@ io_s_popen(mrb_state *mrb, mrb_value klass)
|
||||
pid = pi.dwProcessId;
|
||||
}
|
||||
|
||||
mrb_value io = mrb_obj_value(mrb_data_object_alloc(mrb, mrb_class_ptr(p->klass), NULL, &mrb_io_type));
|
||||
mrb_value io = mrb_obj_value(mrb_data_object_alloc(mrb, mrb_class_ptr(klass), NULL, &mrb_io_type));
|
||||
fptr = io_alloc(mrb);
|
||||
fptr->fd = _open_osfhandle((intptr_t)ofd[0], 0);
|
||||
fptr->fd2 = _open_osfhandle((intptr_t)ifd[1], 0);
|
||||
|
||||
Reference in New Issue
Block a user