Skip to content

arg-cache: Init out parameters with correct number of bits

Philip Chimento requested to merge ptomato/gjs:642-init-out-parameters into master

GIArgument is a 64-bit union. To initialize out parameters, we previously cleared the union's pointer member. However, on 32-bit platforms, the clearing the pointer member only clears half of the bits. We have to clear all 64 bits, so clear one of the int64 members instead.

(Why don't we de-templatize gjs_arg_unset() instead? It's because more generally you may call gjs_arg_set()/gjs_arg_unset() on memory owned by libffi, which may not be the whole 64 bits.)

While we're here, set arg to the address of state->out_cvalue by using the simpler syntax that we use below in set_inout_parameter(), and add some comments to explain what we're doing.

Closes: #642 (closed)

Merge request reports