DynamoRIO / DynamoRIO/dynamorio
aarch64 INSTR_CREATE macros pass 0 for enums, triggering C++ compiler warnings
- Dominant language
- C
- Stars
- 3.2k
- Forks
- 629
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 31
Description
Because there is no INSTR_CREATE_udf() yet (#4562) I generated a SIGILL with INSTR_CREATE_dc_ivac() (privileged instruction): but using it results in failures to build due to passing numeric 0 values to enum parameters to opnd_create_base_disp_aarch64() (this is building a C++ app).
```
FAILED: suite/tests/CMakeFiles/tool.drcacheoff.gencode.dir/__/__/clients/drcachesim/tests/burst_gencode.cpp.o
/usr/bin/c++ -DARM_64 -DDR_HOST_ -DDR_REG_ENUM_COMPATIBILITY -D_LARGEFILE64_SOURCE -I. -I/home/derek/dr/src/suite/tests -I/home/derek/dr/src/core/arch -Icmake/../include -I/home/derek/dr/src/core/drlibc -I/home/derek/dr/src/core/lib -Iinclude/annotations -Isuite/tests/annotations -Iext/include -Icmake/../clients/include -I/home/derek/dr/src/clients/drcachesim -I/home/derek/dr/src/clients/drcachesim/common -I/home/derek/dr/src/clients/drcachesim/reader -I/home/derek/dr/src/clients/drcachesim/tracer -I/home/derek/dr/src/clients/drcachesim/scheduler -DSTATIC_LIBRARY -DUSE_DYNAMO -fno-strict-aliasing -funsigned-char -fno-stack-protector -std=c++11 -g3 -fno-omit-frame-pointer -fno-builtin-strcmp -Werror -Wwrite-strings -Wvla -Wno-unused-but-set-variable -Wno-stringop-truncation -Wno-format-truncation -Wno-stringop-overflow -DNIGHTLY_REGRESSION -DNOT_DYNAMORIO_CORE -MD -MT suite/tests/CMakeFiles/tool.drcacheoff.gencode.dir/__/__/clients/drcachesim/tests/burst_gencode.cpp.o -MF suite/tests/CMakeFiles/tool.drcacheoff.gencode.dir/__/__/clients/drcachesim/tests/burst_gencode.cpp.o.d -o suite/tests/CMakeFiles/tool.drcacheoff.gencode.dir/__/__/clients/drcachesim/tests/burst_gencode.cpp.o -c /home/derek/dr/src/clients/drcachesim/tests/burst_gencode.cpp
In file included from cmake/../include/dr_ir_macros.h:49,
from cmake/../include/dr_api.h:96,
from /home/derek/dr/src/clients/drcachesim/tests/burst_gencode.cpp:40:
/home/derek/dr/src/clients/drcachesim/tests/burst_gencode.cpp: In member function ‘void {anonymous}::code_generator_t::generate_code()’:
cmake/../include/dr_ir_macros_aarch64.h:814:58: error: invalid conversion from ‘int’ to ‘dr_extend_type_t’ {aka ‘_dr_extend_type_t’} [-fpermissive]
814 | 0, false, 0, 0, OPSZ_sys))
| ^
| |
| int
/home/derek/dr/src/clients/drcachesim/tests/burst_gencode.cpp:160:33: note: in expansion of macro ‘INSTR_CREATE_dc_ivac’
160 | instrlist_append(ilist, INSTR_CREATE_dc_ivac(dc, opnd_create_reg(base)));
| ^~~~~~~~~~~~~~~~~~~~
In file included from cmake/../include/dr_api.h:56,
from /home/derek/dr/src/clients/drcachesim/tests/burst_gencode.cpp:40:
cmake/../include/dr_ir_opnd.h:2298:48: note: initializing argument 3 of ‘opnd_t opnd_create_base_disp_aarch64(reg_id_t, reg_id_t, dr_extend_type_t, bool, int, dr_opnd_flags_t, opnd_size_t)’
2298 | dr_extend_type_t extend_type, bool scaled, int disp,
| ~~~~~~~~~~~~~~~~~^~~~~~~~~~~
In file included from cmake/../include/dr_ir_macros.h:49,
from cmake/../include/dr_api.h:96,
from /home/derek/dr/src/clients/drcachesim/tests/burst_gencode.cpp:40:
cmake/../include/dr_ir_macros_aarch64.h:814:71: error: invalid conversion from ‘int’ to ‘dr_opnd_flags_t’ {aka ‘_dr_opnd_flags_t’} [-fpermissive]
814 | 0, false, 0, 0, OPSZ_sys))
| ^
| |
| int
/home/derek/dr/src/clients/drcachesim/tests/burst_gencode.cpp:160:33: note: in expansion of macro ‘INSTR_CREATE_dc_ivac’
160 | instrlist_append(ilist, INSTR_CREATE_dc_ivac(dc, opnd_create_reg(base)));
| ^~~~~~~~~~~~~~~~~~~~
In file included from cmake/../include/dr_api.h:56,
from /home/derek/dr/src/clients/drcachesim/tests/burst_gencode.cpp:40:
cmake/../include/dr_ir_opnd.h:2299:47: note: initializing argument 6 of ‘opnd_t opnd_create_base_disp_aarch64(reg_id_t, reg_id_t, dr_extend_type_t, bool, int, dr_opnd_flags_t, opnd_size_t)’
2299 | dr_opnd_flags_t flags, opnd_size_t size);
| ~~~~~~~~~~~~~~~~^~~~~
[5/220] Building C object core/CMakeFiles/dynamorio_static.dir/ir/aarch64/codec.c.o
ninja: build stopped: subcommand failed.
```
Contributor guide
Assessment
This issue has not been assessed yet.