Skip to content

Commit

Permalink
String constants should be marked as DT_NF_DPTR
Browse files Browse the repository at this point in the history
Although string constants are represented using a scalar offset into the
string constant table, the generated BPF code uses actual pointers into
the string constant table.  They are therefore pointers to DTrace-managed
storage (DT_NF_DPTR).

Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
Reviewed-by: Eugene Loh <eugene.loh@oracle.com>
  • Loading branch information
kvanhees committed Oct 26, 2022
1 parent 9cd99d9 commit cfd19c9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions libdtrace/dt_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -1318,6 +1318,7 @@ dt_node_string(char *string)
dnp = dt_node_alloc(DT_NODE_STRING);
dnp->dn_op = DT_TOK_STRING;
dnp->dn_string = string;
dnp->dn_flags |= DT_NF_DPTR;
dt_node_type_assign(dnp, DT_STR_CTFP(dtp), DT_STR_TYPE(dtp));

return dnp;
Expand Down

0 comments on commit cfd19c9

Please sign in to comment.