Skip to content

Commit 3b77c9d

Browse files
authored
Merge pull request #175 from sipma/functionannotations
Functionannotations
2 parents 3abc886 + 33a7858 commit 3b77c9d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CodeHawk/CHB/bchlib/bCHMemoryReference.ml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ and get_field_memory_offset_at
329329
Error [__FILE__ ^ ":" ^ (string_of_int __LINE__) ^ ": "
330330
^ "Skipped over field: "
331331
^ (string_of_int offset)]
332-
else if offset > (foff + sz) then
332+
else if offset >= (foff + sz) then
333333
Ok None
334334
else
335335
let offset = offset - foff in
@@ -369,7 +369,9 @@ and get_field_memory_offset_at
369369
Error [__FILE__ ^ ":" ^ (string_of_int __LINE__) ^ ": "
370370
^ "Nonzero offset: " ^ (string_of_int offset)
371371
^ " with unstructured field type: "
372-
^ (btype_to_string fldtype)])
372+
^ (btype_to_string fldtype)
373+
^ " for field "
374+
^ finfo.bfname])
373375
(resolve_type finfo.bftype)) (Ok None) finfos in
374376
(match optfield_r with
375377
| Error e -> Error e

CodeHawk/CHB/bchlib/bCHVariable.ml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -832,6 +832,10 @@ object (self)
832832
(cv1: constant_value_variable_t)
833833
(cv2: constant_value_variable_t) =
834834
match (cv1, cv2) with
835+
| (TypeCastValue _, TypeCastValue _) -> Stdlib.compare ix1 ix2
836+
| (TypeCastValue _, _) -> -1
837+
| (_, TypeCastValue _) -> 1
838+
835839
| (FunctionReturnValue _, FunctionReturnValue _) -> Stdlib.compare ix1 ix2
836840
| (FunctionReturnValue _, _) -> -1
837841
| (_, FunctionReturnValue _) -> 1

0 commit comments

Comments
 (0)