projects
/
nestedvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
have cstring() return null if passed a null pointer
[nestedvm.git]
/
src
/
org
/
ibex
/
nestedvm
/
Runtime.java
diff --git
a/src/org/ibex/nestedvm/Runtime.java
b/src/org/ibex/nestedvm/Runtime.java
index
4618dc3
..
5c2cc6a
100644
(file)
--- a/
src/org/ibex/nestedvm/Runtime.java
+++ b/
src/org/ibex/nestedvm/Runtime.java
@@
-1252,6
+1252,7
@@
public abstract class Runtime implements UsermodeConstants,Registers,Cloneable {
/** Helper function to read a cstring from main memory */
public final String cstring(int addr) throws ReadFaultException {
+ if (addr == 0) return null;
StringBuffer sb = new StringBuffer();
for(;;) {
int word = memRead(addr&~3);