aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_trace.c
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2011-05-03 14:20:22 +0200
committerBjörn Gustavsson <[email protected]>2011-05-11 09:20:01 +0200
commit8d1dd7079fdcd22765b30a1268649022360f6f56 (patch)
treeded2ecc4254e6668ef4c8ff38081001170a8949d /erts/emulator/beam/erl_trace.c
parent2ef48dca9328e0b928117f21bc9ee6dbc5a614cc (diff)
downloadotp-8d1dd7079fdcd22765b30a1268649022360f6f56.tar.gz
otp-8d1dd7079fdcd22765b30a1268649022360f6f56.tar.bz2
otp-8d1dd7079fdcd22765b30a1268649022360f6f56.zip
erl_trace: Eliminate alias warning
Avoid creating two variable names referring to the same memory area, because that can cause aliasing warnings in some versions of gcc.
Diffstat (limited to 'erts/emulator/beam/erl_trace.c')
-rw-r--r--erts/emulator/beam/erl_trace.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/erts/emulator/beam/erl_trace.c b/erts/emulator/beam/erl_trace.c
index c0397ca6c3..8833137112 100644
--- a/erts/emulator/beam/erl_trace.c
+++ b/erts/emulator/beam/erl_trace.c
@@ -1538,8 +1538,7 @@ erts_call_trace(Process* p, BeamInstr mfa[3], Binary *match_spec,
Eterm tracee;
#endif
Eterm transformed_args[MAX_ARG];
- DeclareTmpHeap(sub_bin_heap_et,ERL_SUB_BIN_SIZE,p);
- ErlSubBin *sub_bin_heap = (ErlSubBin *) sub_bin_heap_et;
+ DeclareTypedTmpHeap(ErlSubBin,sub_bin_heap,p);
ASSERT(tracer_pid);
if (*tracer_pid == am_true) {
@@ -1600,21 +1599,20 @@ erts_call_trace(Process* p, BeamInstr mfa[3], Binary *match_spec,
if (is_boxed(arg) && header_is_bin_matchstate(*boxed_val(arg))) {
ErlBinMatchState* ms = (ErlBinMatchState *) boxed_val(arg);
ErlBinMatchBuffer* mb = &ms->mb;
- ErlSubBin* sb = sub_bin_heap;
Uint bit_size;
ASSERT(sub_bin_heap->thing_word == 0); /* At most one of match context */
bit_size = mb->size - mb->offset;
- sb->thing_word = HEADER_SUB_BIN;
- sb->size = BYTE_OFFSET(bit_size);
- sb->bitsize = BIT_OFFSET(bit_size);
- sb->offs = BYTE_OFFSET(mb->offset);
- sb->bitoffs = BIT_OFFSET(mb->offset);
- sb->is_writable = 0;
- sb->orig = mb->orig;
-
- arg = make_binary(sb);
+ sub_bin_heap->thing_word = HEADER_SUB_BIN;
+ sub_bin_heap->size = BYTE_OFFSET(bit_size);
+ sub_bin_heap->bitsize = BIT_OFFSET(bit_size);
+ sub_bin_heap->offs = BYTE_OFFSET(mb->offset);
+ sub_bin_heap->bitoffs = BIT_OFFSET(mb->offset);
+ sub_bin_heap->is_writable = 0;
+ sub_bin_heap->orig = mb->orig;
+
+ arg = make_binary(sub_bin_heap);
}
transformed_args[i] = arg;
}