Displaying 5 results from an estimated 5 matches for "hcd_priv".
2007 Nov 13
0
[LLVMdev] BasicAliasAnalysis and out-of-bound GEP indices
...ion of
> preprocessed ehci-hcd.c file (from Linux kernel; compilation of this
> file discovered bug #1782).
>
> --Wojtek
> struct device;
>
> struct usb_bus {
> struct device *controller;
> };
>
> struct usb_hcd {
> struct usb_bus self;
>
> unsigned long hcd_priv[0];
> };
>
> struct ehci_hcd;
>
> static inline __attribute__((always_inline)) struct ehci_hcd
> *hcd_to_ehci (struct usb_hcd *hcd)
> {
> return (struct ehci_hcd *) (hcd->hcd_priv);
> }
>
> static inline __attribute__((always_inline)) struct usb_hcd
> *eh...
2007 Nov 13
2
[LLVMdev] BasicAliasAnalysis and out-of-bound GEP indices
Hi!
While investigating into the PR1782 I spent some time analyzing
BasicAliasAnalysis.cpp. While the mentioned problem should be fixed now
(I hope), I have discovered some other possibilities for a bug to occur.
In the case of checking for aliasing of two pointer values, where at
least one of them is a GEP instruction with out-of-bound indices,
BasicAliasAnalysis can return NoAlias, even if the
2007 Nov 15
2
[LLVMdev] BasicAliasAnalysis and out-of-bound GEP indices
...ilation of this
> > file discovered bug #1782).
> >
> > --Wojtek
> > struct device;
> >
> > struct usb_bus {
> > struct device *controller;
> > };
> >
> > struct usb_hcd {
> > struct usb_bus self;
> >
> > unsigned long hcd_priv[0];
> > };
> >
> > struct ehci_hcd;
> >
> > static inline __attribute__((always_inline)) struct ehci_hcd
> > *hcd_to_ehci (struct usb_hcd *hcd)
> > {
> > return (struct ehci_hcd *) (hcd->hcd_priv);
> > }
> >
> > static inline __a...
2007 Nov 15
3
[LLVMdev] BasicAliasAnalysis and out-of-bound GEP indices
...ld work fine (it wouldn't work if it was char name[1]
> though).
>
Then the original reported code is fine, and the bug is in llvm or
llvm-gc (IE Owen is wrong)
Note:
struct device;
struct usb_bus {
struct device *controller;
};
struct usb_hcd {
struct usb_bus self;
unsigned long hcd_priv[0];
};
...
> Ciao,
>
> Duncan.
>
2007 Nov 15
0
[LLVMdev] BasicAliasAnalysis and out-of-bound GEP indices
Hi,
> Sadly, this will break a very common idiom. In GCC, we discovered it
> to be common enough that it broke a *bunch* of C code.
>
> In particular, you will break
>
> struct foo {
> int a;
> char name[0];
> }
>
> bar = malloc(sizeof (struct foo) + strlen("thisismyname") + 1);
> strcpy(bar->name, "thisismyname");
>
>
> It