testsuite/semko/autocast01.stp
raw| 1 | #! stap -p2 |
| 2 | |
| 3 | probe begin |
| 4 | { |
| 5 | sun_path = @cast(0, "sockaddr_un", "<sys/un.h>")->sun_path; |
| 6 | |
| 7 | // The parser treats this as an arrayindex on a global, rather than an |
| 8 | // autocast [0], because it can't know yet whether it really is a global. |
| 9 | // This is a syntax ambiguity which we've chosen to resolve in the legacy |
| 10 | // direction. If you really wanted autocast, use (sun_path)[0]. |
| 11 | println(sun_path[0]) |
| 12 | } |