Fix: re-allow non-lvalue string, sequence, array parameters
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 7 Nov 2012 18:24:58 +0000 (13:24 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 7 Nov 2012 18:24:58 +0000 (13:24 -0500)
Issue introduced by upstream commit:

  commit 27f4b6094f399f2fe231b58801dce98cbd21baa9
  Author: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
  Date: Tue Sep 4 12:17:07 2012 -0400

  Fix filter: pointer to string, not string, should be on stack

  Fixes #329

Reported-by: David Bryant <david.bryant@quantum.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/lttng/ust-tracepoint-event.h

index 8f0db41fc3c7c5490a38d5186661b7f68005c1af..2ff736e2f5c1cd2ad6581c9d3330d9eb43165586 100644 (file)
@@ -296,9 +296,10 @@ size_t __event_get_size__##_provider##___##_name(size_t *__dynamic_len, _TP_ARGS
 #define _ctf_array_encoded(_type, _item, _src, _length, _encoding, _nowrite)   \
        {                                                                      \
                unsigned long __ctf_tmp_ulong = (unsigned long) (_length);     \
+               void *__ctf_tmp_ptr = (_src);                                  \
                memcpy(__stack_data, &__ctf_tmp_ulong, sizeof(unsigned long)); \
                __stack_data += sizeof(unsigned long);                         \
-               memcpy(__stack_data, &(_src), sizeof(void **));                \
+               memcpy(__stack_data, &__ctf_tmp_ptr, sizeof(void **));         \
                __stack_data += sizeof(void **);                               \
        }
 
@@ -307,16 +308,18 @@ size_t __event_get_size__##_provider##___##_name(size_t *__dynamic_len, _TP_ARGS
                        _src_length, _encoding, _nowrite)                      \
        {                                                                      \
                unsigned long __ctf_tmp_ulong = (unsigned long) (_src_length); \
+               void *__ctf_tmp_ptr = (_src);                                  \
                memcpy(__stack_data, &__ctf_tmp_ulong, sizeof(unsigned long)); \
                __stack_data += sizeof(unsigned long);                         \
-               memcpy(__stack_data, &(_src), sizeof(void **));                \
+               memcpy(__stack_data, &__ctf_tmp_ptr, sizeof(void **));         \
                __stack_data += sizeof(void **);                               \
        }
 
 #undef _ctf_string
 #define _ctf_string(_item, _src, _nowrite)                                    \
        {                                                                      \
-               memcpy(__stack_data, &(_src), sizeof(void **));                \
+               void *__ctf_tmp_ptr = (_src);                                  \
+               memcpy(__stack_data, &__ctf_tmp_ptr, sizeof(void **));         \
                __stack_data += sizeof(void **);                               \
        }
 
This page took 0.025898 seconds and 4 git commands to generate.