Move 8051 test into db/tools/rasm2 and fix null deref in asm ##asm

This commit is contained in:
pancake 2022-05-07 22:27:58 +02:00
parent 04ee6f377e
commit 0693e54354
5 changed files with 17 additions and 6 deletions

View File

@ -667,7 +667,9 @@ static int print_assembly_output(RAsmState *as, const char *buf, ut64 offset, ut
if (rad) {
printf ("f entry = $$\n");
printf ("f label.main = $$ + 1\n");
ht_pp_foreach (as->a->flags, print_label, NULL);
if (as->a->flags) {
ht_pp_foreach (as->a->flags, print_label, NULL);
}
}
return ret;
}

View File

@ -1,4 +1,4 @@
all: r2r-tests unit_tests test-8051-reassembly
all: r2r-tests unit_tests
arm.v35:
${RUNTEST} db/extras/asm/arm.v35_64
@ -17,9 +17,6 @@ RUNTEST=r2r -L -o results.json
r2r-tests: bins
${RUNTEST}
test-8051-reassembly:
$(SHELL) ./test-8051-reassembly.sh
fuzz-tests: bins
r2r -LF bins/fuzzed @fuzz

View File

@ -1,3 +1,14 @@
NAME=test 8051 reassembly
FILE=--
CMDS=!scripts/test-8051-reassembly.sh
EXPECT=<<EOF
Reassembling 8051... OK
EOF
EXPECT_ERR=<<EOF
Warning: using oba to load the syminfo from different mapaddress.
EOF
RUN
NAME=rasm2 binary input
FILE=-
ARGS=-a arm -b 64

View File

@ -1,3 +1,4 @@
#!/bin/sh
BUILD_DIRECTORY=$(mktemp -d tmp.XXXXXXXXXX)
[ -z "$BUILD_DIRECTORY" ] && exit 1
export EXIT_CODE=0

View File

@ -3,6 +3,6 @@
r2 -N -e http.port=9393 -qq -c=h bins/elf/arg > /dev/null 2>&1 &
CHILD=$!
curl -s --retry 30 --retry-delay 1 --retry-connrefused http://127.0.0.1:9393/ > /dev/null 2>&1
r2 -N -qc '=0 pd 10' -C http://127.0.0.1:9393/cmd
r2 -N -qc '=0 pd 10@e:asm.cmt.right=false' -C http://127.0.0.1:9393/cmd
r2 -N -c 'b $s;pr~:0..11' -qcq http://127.0.0.1:9393/
kill $CHILD