-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial support for static fields in JcInterpreter (#30)
- Loading branch information
Showing
64 changed files
with
399 additions
and
207 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
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 was deleted.
Oops, something went wrong.
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
44 changes: 44 additions & 0 deletions
44
usvm-jvm/src/samples/java/org/usvm/samples/objects/ObjectWithStatics.java
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,44 @@ | ||
package org.usvm.samples.objects; | ||
|
||
public class ObjectWithStatics { | ||
static Object refStaticField; | ||
|
||
static int primitiveStaticField; | ||
|
||
static { | ||
refStaticField = new Object(); | ||
primitiveStaticField = 17; | ||
} | ||
|
||
private Object getRefFiled() { | ||
return refStaticField; | ||
} | ||
|
||
private int getPrimitiveFiled() { | ||
return primitiveStaticField; | ||
} | ||
|
||
int staticsAreEqual() { | ||
if (ObjectWithStatics.refStaticField != getRefFiled()) { | ||
return 1; | ||
} | ||
if (ObjectWithStatics.primitiveStaticField != getPrimitiveFiled()) { | ||
return 2; | ||
} | ||
return 0; | ||
} | ||
|
||
int mutateStatics() { | ||
int initial = getPrimitiveFiled(); | ||
primitiveStaticField++; | ||
int mutated = getPrimitiveFiled(); | ||
return mutated - initial; | ||
} | ||
|
||
int staticsInitialized() { | ||
if (ObjectWithStatics.primitiveStaticField != 17) { | ||
return 1; | ||
} | ||
return 0; | ||
} | ||
} |
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
Oops, something went wrong.