Re: Sparse-LLVM issue compiling NULL pointers

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

 



On Wed, Mar 01, 2017 at 02:45:03PM +0000, Dibyendu Majumdar wrote:
> On 1 March 2017 at 10:58, Dibyendu Majumdar <mobile@xxxxxxxxxxxxxxx> wrote:
> > On 28 February 2017 at 17:03, Luc Van Oostenryck
> > <luc.vanoostenryck@xxxxxxxxx> wrote:
> >> On Tue, Feb 28, 2017 at 4:09 PM, Luc Van Oostenryck
> >> <luc.vanoostenryck@xxxxxxxxx> wrote:
> >>> There is indeed some problems regarding this, we looked a bit at this
> >>> some weeks ago. However I firmly believe that the information about
> >>> the type belong to the operations and not the values.
> >>
> >
> > I am trying to work out how a value pseudo correct type can be
> > determined when the pseudo is a function call argument. Would
> > appreciate any pointers on this. The current implementation of
> > pseudo_to_value() uses the function call instruction which is
> > incorrect.
> >
> 
> I have implemented a solution that get the type information from the
> function prototype for pseudo values when processing function
> arguments, but not sure this is correct.

You need something like:
+struct symbol *argument_type(pseudo_t src)
+{
+	struct entrypoint *ep = src->def->bb->ep;
+	struct symbol_list *args = ep->name->ctype.base_type->arguments;
+	struct symbol *arg;
+	int i = 0;
+	FOR_EACH_PTR(args, arg) {
+		if (++i == src->nr)
+			return arg;
+	} END_FOR_EACH_PTR(arg);
+
+	assert(0);
+}
 
> Anyway have hit a bunch of other issues with sparse-llvm ... :-(

Each day its problem (and happily its solution too!).


Luc
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux