From fbb10cf73d35e0534db2735d2da4bedf39882fb6 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Thu, 21 Aug 2025 10:17:12 +0900 Subject: [PATCH] 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 --- mrbgems/mruby-io/src/io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mrbgems/mruby-io/src/io.c b/mrbgems/mruby-io/src/io.c index 5cd388643..28c676763 100644 --- a/mrbgems/mruby-io/src/io.c +++ b/mrbgems/mruby-io/src/io.c @@ -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);