[PATCH] Fix trace segfault for non-daemon functions (RHBZ#682756).
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming blog: http://rwmj.wordpress.com Fedora now supports 80 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora
Previous patch broke RConstOptString. Try this updated version. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones New in Fedora 11: Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 70 libraries supprt'd http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw
On 07/03/11 16:46, Richard W.M. Jones wrote:
From 7c721e4fd674c409b3eee60fe237d480afa1c5e2 Mon Sep 17 00:00:00 2001 From: Richard W.M. Jones<rjones@redhat.com> Date: Mon, 7 Mar 2011 15:55:56 +0000 Subject: [PATCH] Fix trace segfault for non-daemon functions (RHBZ#682756).
Previously we expanded the code for 'trace_return' unconditionally for all non-daemon functions. However this code was not prepared to handle all error conditions, and in fact would segfault if it tried to print RStringList or RHashtable where r == NULL.
We need to make the code conditional on the return value, calling either 'trace_return' or 'trace_return_error' as appropriate.
Note the difficult case for RConstOptString which returns NULL in non-error cases. --- generator/generator_c.ml | 47 +++++++++++++++++++++++++++++---------------- 1 files changed, 30 insertions(+), 17 deletions(-)
ACK. Matt -- Matthew Booth, RHCA, RHCSS Red Hat Engineering, Virtualisation Team GPG ID: D33C3490 GPG FPR: 3733 612D 2D05 5458 8A8A 1600 3441 EA19 D33C 3490
participants (2)
-
Matthew Booth -
Richard W.M. Jones