summaryrefslogtreecommitdiff
path: root/ext/win32ole
diff options
context:
space:
mode:
authorsuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-18 02:53:18 +0000
committersuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-18 02:53:18 +0000
commit8f67e9807a9cf252c9330c7273820cd99db36b13 (patch)
tree0e5c29ecb679b1c6ccdd6c0660470def50ab0fbb /ext/win32ole
parent8287581afce60aa9b6f4a9ea123594c8a2cebb53 (diff)
* ext/win32ole/win32ole.c (ole_invoke): avoid SEGV when VT_RECORD
variable is passed by reference. [ruby-dev:48803] [Bug #10697] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49315 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/win32ole')
-rw-r--r--ext/win32ole/win32ole.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c
index 582ff32..c60564d 100644
--- a/ext/win32ole/win32ole.c
+++ b/ext/win32ole/win32ole.c
@@ -2663,6 +2663,10 @@ ole_invoke(int argc, VALUE *argv, VALUE self, USHORT wFlags, BOOL is_bracket)
param = rb_ary_entry(paramS, i-cNamedArgs);
if (rb_obj_is_kind_of(param, cWIN32OLE_VARIANT)) {
ole_variant2variant(param, &op.dp.rgvarg[n]);
+ } else if (rb_obj_is_kind_of(param, cWIN32OLE_RECORD)) {
+ ole_val2variant(param, &realargs[n]);
+ op.dp.rgvarg[n] = realargs[n];
+ V_VT(&op.dp.rgvarg[n]) = VT_RECORD | VT_BYREF;
} else {
ole_val2variant(param, &realargs[n]);
V_VT(&op.dp.rgvarg[n]) = VT_VARIANT | VT_BYREF;