From: Mathieu Desnoyers Date: Wed, 7 Nov 2012 18:24:58 +0000 (-0500) Subject: Fix: re-allow non-lvalue string, sequence, array parameters X-Git-Tag: v2.1.0-rc2~19 X-Git-Url: https://git.lttng.org/?a=commitdiff_plain;h=c4261b0aecaf281fc1ced4c7af96b1ff6d2600d7;p=lttng-ust.git Fix: re-allow non-lvalue string, sequence, array parameters Issue introduced by upstream commit: commit 27f4b6094f399f2fe231b58801dce98cbd21baa9 Author: Mathieu Desnoyers 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 Signed-off-by: Mathieu Desnoyers --- diff --git a/include/lttng/ust-tracepoint-event.h b/include/lttng/ust-tracepoint-event.h index 8f0db41f..2ff736e2 100644 --- a/include/lttng/ust-tracepoint-event.h +++ b/include/lttng/ust-tracepoint-event.h @@ -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 **); \ }