-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
x86: Pass the right nameEnv in resolvePtrSetupValue
Previously, `resolvePtrSetupValue` would pass an empty `Map` of `Ident` to `resolveSetupVal`, which prevented SAW from lookup up struct field names properly. The fix is quite straightforward, luckily enough. Fixes #1533.
- Loading branch information
1 parent
a648349
commit c0ed1a0
Showing
8 changed files
with
60 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
CC = clang | ||
CFLAGS = -g -frecord-command-line -O0 | ||
|
||
all: test.bc test.exe | ||
|
||
test.bc: test.c | ||
$(CC) $(CFLAGS) -c -emit-llvm $< -o $@ | ||
|
||
test.o: test.c | ||
$(CC) $(CFLAGS) -c $< -o $@ | ||
|
||
test.exe: test.o | ||
$(CC) $(CFLAGS) $< -o $@ | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -f test.bc test.exe |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#include <stdint.h> | ||
|
||
struct s { | ||
uint8_t x1; | ||
uint8_t x2; | ||
}; | ||
|
||
uint8_t get_x2(struct s *ss) { | ||
return ss->x2; | ||
} | ||
|
||
int main() { | ||
return 0; | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
enable_experimental; | ||
|
||
let get_x2_spec = do { | ||
ss <- llvm_alloc (llvm_alias "struct.s"); | ||
z <- llvm_fresh_var "z" (llvm_int 8); | ||
llvm_points_to (llvm_field ss "x2") (llvm_term z); | ||
llvm_execute_func [ss]; | ||
llvm_return (llvm_term z); | ||
}; | ||
|
||
m <- llvm_load_module "test.bc"; | ||
|
||
llvm_verify m "get_x2" [] false get_x2_spec (w4_unint_z3 []); | ||
llvm_verify_x86 m "test.exe" "get_x2" [] false get_x2_spec (w4_unint_z3 []); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
$SAW test.saw |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters