qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] test-qapi-visit causes clang -fsanitize=undefined warni


From: Markus Armbruster
Subject: Re: [Qemu-devel] test-qapi-visit causes clang -fsanitize=undefined warning
Date: Mon, 10 Mar 2014 13:21:06 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

Peter Maydell <address@hidden> writes:

> I've noticed that the tests/test-qapi-visit.c code provokes the following
> complaint from clang's -fsanitize=undefined undefined-behaviour
> checker when you run 'make check':
>
> tests/test-qapi-visit.c:462:33: runtime error: member access within
> null pointer of type 'UserDefA' (aka 'struct UserDefA')
>
> which is the line
>     visit_type_bool(m, &(*obj)->boolean, "boolean", &err);
> in static void visit_type_UserDefA_fields(Visitor *m, UserDefA ** obj,
> Error **errp).
>
> It's presumably complaining because we've passed in an obj which
> points to NULL (ie *obj == NULL). The callsite in visit_type_UserDefA()
> checks for this and doesn't call the visit..fields function. The callsite
> in visit_type_UserDefFlatUnion doesn't.
>
> Unfortunately this is all autogenerated C so I'm not sure where exactly
> the bug should be fixed. Could one of you have a look at it?

My local clang doesn't complain.  May I have your clang version, exact
invocation and output?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]