Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mu-impl-ref2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mu
mu-impl-ref2
Commits
ea45e61b
Commit
ea45e61b
authored
Oct 01, 2018
by
George Rayns
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extra debugging and other things
parent
2990e693
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
4 deletions
+16
-4
src/main/scala/uvm/refimpl/MuCtx.scala
src/main/scala/uvm/refimpl/MuCtx.scala
+3
-0
src/main/scala/uvm/refimpl/itpr/operationHelpers.scala
src/main/scala/uvm/refimpl/itpr/operationHelpers.scala
+0
-1
src/main/scala/uvm/refimpl/mem/MemorySupport.scala
src/main/scala/uvm/refimpl/mem/MemorySupport.scala
+5
-2
src/main/scala/uvm/staticanalysis/BundleChecker.scala
src/main/scala/uvm/staticanalysis/BundleChecker.scala
+8
-1
No files found.
src/main/scala/uvm/refimpl/MuCtx.scala
View file @
ea45e61b
...
...
@@ -367,11 +367,14 @@ class MuCtx(val ctxID: MuInternalID, _mutator: Mutator)(
MemoryOperations
.
load
(
ptr
,
uty
,
addr
,
nb
)
print
(
"Loading: "
+
nb
+
"\n"
)
addHandle
(
MuValue
(
uty
,
nb
))
}
/** Store to a location. */
def
store
(
ord
:
MemoryOrder
,
loc
:
MuIRefValue
,
newVal
:
MuValue
)
:
Unit
=
{
print
(
"Storing: "
+
newVal
+
"\n"
)
val
(
ptr
,
ty
)
=
loc
.
ty
match
{
case
TypeIRef
(
t
)
=>
(
false
,
t
)
}
...
...
src/main/scala/uvm/refimpl/itpr/operationHelpers.scala
View file @
ea45e61b
...
...
@@ -462,7 +462,6 @@ object MemoryOperations {
case
_
=>
throw
new
UvmUnimplementedOperationException
(
"Loading int of length %d is not supported"
.
format
(
l
))
}
logger
.
debug
(
"Loaded: "
+
bi
)
br
.
asInstanceOf
[
BoxInt
].
value
=
OpHelper
.
unprepare
(
bi
,
l
)
case
_:
TypeFloat
=>
val
fv
=
memorySupport
.
loadFloat
(
loc
,
!
ptr
)
...
...
src/main/scala/uvm/refimpl/mem/MemorySupport.scala
View file @
ea45e61b
...
...
@@ -3,6 +3,7 @@ package uvm.refimpl.mem
import
uvm._
import
uvm.refimpl._
import
uvm.refimpl.integerize._
import
uvm.refimpl.itpr.InterpreterThread.logger
import
uvm.refimpl.nat.NativeSupport
import
uvm.ssavariables.AtomicRMWOptr._
...
...
@@ -40,7 +41,8 @@ class MemorySupport(val muMemorySize: Word) extends AutoCloseable {
def
loadByte
(
addr
:
Word
,
inMu
:
Boolean
=
true
)
:
Byte
=
{
assertInMuMemory
(
inMu
,
addr
);
theMemory
.
getByte
(
addr
)
}
def
loadShort
(
addr
:
Word
,
inMu
:
Boolean
=
true
)
:
Short
=
{
assertInMuMemory
(
inMu
,
addr
);
theMemory
.
getShort
(
addr
)
}
def
loadInt
(
addr
:
Word
,
inMu
:
Boolean
=
true
)
:
Int
=
{
assertInMuMemory
(
inMu
,
addr
);
theMemory
.
getInt
(
addr
)
}
def
loadLong
(
addr
:
Word
,
inMu
:
Boolean
=
true
)
:
Long
=
{
assertInMuMemory
(
inMu
,
addr
);
theMemory
.
getLong
(
addr
)
}
def
loadLong
(
addr
:
Word
,
inMu
:
Boolean
=
true
)
:
Long
=
{
assertInMuMemory
(
inMu
,
addr
);
val
v
=
theMemory
.
getLong
(
addr
);
logger
.
debug
(
"Loaded: "
+
v
);
v
}
def
loadI128
(
addr
:
Word
,
inMu
:
Boolean
=
true
)
:
(
Long
,
Long
)
=
{
assertInMuMemory
(
inMu
,
addr
);
(
theMemory
.
getLong
(
addr
),
theMemory
.
getLong
(
addr
+
8
))
}
def
loadFloat
(
addr
:
Word
,
inMu
:
Boolean
=
true
)
:
Float
=
{
assertInMuMemory
(
inMu
,
addr
);
theMemory
.
getFloat
(
addr
)
}
def
loadDouble
(
addr
:
Word
,
inMu
:
Boolean
=
true
)
:
Double
=
{
assertInMuMemory
(
inMu
,
addr
);
theMemory
.
getDouble
(
addr
)
}
...
...
@@ -48,7 +50,8 @@ class MemorySupport(val muMemorySize: Word) extends AutoCloseable {
def
storeByte
(
addr
:
Word
,
v
:
Byte
,
inMu
:
Boolean
=
true
)
:
Unit
=
{
assertInMuMemory
(
inMu
,
addr
);
theMemory
.
putByte
(
addr
,
v
)
}
def
storeShort
(
addr
:
Word
,
v
:
Short
,
inMu
:
Boolean
=
true
)
:
Unit
=
{
assertInMuMemory
(
inMu
,
addr
);
theMemory
.
putShort
(
addr
,
v
)
}
def
storeInt
(
addr
:
Word
,
v
:
Int
,
inMu
:
Boolean
=
true
)
:
Unit
=
{
assertInMuMemory
(
inMu
,
addr
);
theMemory
.
putInt
(
addr
,
v
)
}
def
storeLong
(
addr
:
Word
,
v
:
Long
,
inMu
:
Boolean
=
true
)
:
Unit
=
{
assertInMuMemory
(
inMu
,
addr
);
theMemory
.
putLong
(
addr
,
v
)
}
def
storeLong
(
addr
:
Word
,
v
:
Long
,
inMu
:
Boolean
=
true
)
:
Unit
=
{
assertInMuMemory
(
inMu
,
addr
);
theMemory
.
putLong
(
addr
,
v
);
logger
.
debug
(
"Stored: "
+
v
)
}
def
storeI128
(
addr
:
Word
,
v
:
(
Long
,
Long
),
inMu
:
Boolean
=
true
)
:
Unit
=
{
assertInMuMemory
(
inMu
,
addr
);
val
(
low
,
high
)
=
v
;
theMemory
.
putLong
(
addr
,
low
);
theMemory
.
putLong
(
addr
+
8
,
high
)
}
def
storeFloat
(
addr
:
Word
,
v
:
Float
,
inMu
:
Boolean
=
true
)
:
Unit
=
{
assertInMuMemory
(
inMu
,
addr
);
theMemory
.
putFloat
(
addr
,
v
)
}
def
storeDouble
(
addr
:
Word
,
v
:
Double
,
inMu
:
Boolean
=
true
)
:
Unit
=
{
assertInMuMemory
(
inMu
,
addr
);
theMemory
.
putDouble
(
addr
,
v
)
}
...
...
src/main/scala/uvm/staticanalysis/BundleChecker.scala
View file @
ea45e61b
...
...
@@ -605,7 +605,14 @@ class BundleChecker {
}
}
case
i
:
InstGetFieldIRef
=>
{
try
{
checkPtrAndOpnd
(
i
.
ptr
,
i
.
opnd
.
inferredType
)
}
catch
{
case
fbi
:
StaticCheckingException
=>
{
println
(
s
"The operand was: ${i.opnd}"
)
throw
fbi
}
}
i
.
referentTy
match
{
case
_:
AbstractStructType
=>
case
ty
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment