Skip to content

Commit 8db6b22

Browse files
Merge pull request diffblue#2139 from romainbrenguier/bugfix/annotations-as-comments
[TG-3368] Make annotations comments in irep_idt
2 parents ce9f046 + da940a9 commit 8db6b22

File tree

6 files changed

+25
-3
lines changed

6 files changed

+25
-3
lines changed
Binary file not shown.
624 Bytes
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
@interface FieldAnnotation {
2+
}
3+
4+
public class Test {
5+
@FieldAnnotation
6+
public static double d;
7+
8+
public void check() {
9+
double f = d;
10+
assert(f == d);
11+
assert(f != d);
12+
}
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE
2+
Test.class
3+
--function Test.check
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
assertion at file Test.java line 10 .* SUCCESS
7+
assertion at file Test.java line 11 .* FAILURE
8+
--
9+
--

src/java_bytecode/java_types.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@ class annotated_typet : public typet
7171
{
7272
// This cast should be safe as java_annotationt doesn't add data to irept
7373
return reinterpret_cast<const std::vector<java_annotationt> &>(
74-
find(ID_annotations).get_sub());
74+
find(ID_C_annotations).get_sub());
7575
}
7676

7777
std::vector<java_annotationt> &get_annotations()
7878
{
7979
// This cast should be safe as java_annotationt doesn't add data to irept
8080
return reinterpret_cast<std::vector<java_annotationt> &>(
81-
add(ID_annotations).get_sub());
81+
add(ID_C_annotations).get_sub());
8282
}
8383
};
8484

src/util/irep_ids.def

+1-1
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ IREP_ID_TWO(overflow_shl, overflow-shl)
670670
IREP_ID_TWO(C_no_initialization_required, #no_initialization_required)
671671
IREP_ID_TWO(overlay_class, java::com.diffblue.OverlayClassImplementation)
672672
IREP_ID_TWO(overlay_method, java::com.diffblue.OverlayMethodImplementation)
673-
IREP_ID_ONE(annotations)
673+
IREP_ID_TWO(C_annotations, #annotations)
674674

675675
// Projects depending on this code base that wish to extend the list of
676676
// available ids should provide a file local_irep_ids.h in their source tree and

0 commit comments

Comments
 (0)