Skip to content

Commit fbb10cf

Browse files
matzGemini
andcommitted
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>
1 parent c5d8c72 commit fbb10cf

File tree

1 file changed

+1
-1
lines changed
  • mrbgems/mruby-io/src

1 file changed

+1
-1
lines changed

mrbgems/mruby-io/src/io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ io_s_popen(mrb_state *mrb, mrb_value klass)
468468
pid = pi.dwProcessId;
469469
}
470470

471-
mrb_value io = mrb_obj_value(mrb_data_object_alloc(mrb, mrb_class_ptr(p->klass), NULL, &mrb_io_type));
471+
mrb_value io = mrb_obj_value(mrb_data_object_alloc(mrb, mrb_class_ptr(klass), NULL, &mrb_io_type));
472472
fptr = io_alloc(mrb);
473473
fptr->fd = _open_osfhandle((intptr_t)ofd[0], 0);
474474
fptr->fd2 = _open_osfhandle((intptr_t)ifd[1], 0);

0 commit comments

Comments
 (0)