summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2014-06-20 14:12:19 +0100
committerJosé Fonseca <jfonseca@vmware.com>2014-06-24 16:30:34 +0100
commit66b7bcc2be115fb1528b6bdf75798e60cc59721f (patch)
tree0ef0efc74bf57c9916d1cf1d62823c02340f1824 /cli
parent01fc85bb71cb7518f17ca789429f137727970737 (diff)
cli/pickle: Treat pointers specially.
Diffstat (limited to 'cli')
-rw-r--r--cli/cli_pickle.cpp2
-rw-r--r--cli/pickle.hpp10
2 files changed, 11 insertions, 1 deletions
diff --git a/cli/cli_pickle.cpp b/cli/cli_pickle.cpp
index 761f3118..8ea507be 100644
--- a/cli/cli_pickle.cpp
+++ b/cli/cli_pickle.cpp
@@ -152,7 +152,7 @@ public:
}
void visit(Pointer *node) {
- writer.writeInt(node->value);
+ writer.writePointer(node->value);
}
void visit(Repr *r) {
diff --git a/cli/pickle.hpp b/cli/pickle.hpp
index aaecc188..35973ef5 100644
--- a/cli/pickle.hpp
+++ b/cli/pickle.hpp
@@ -296,6 +296,16 @@ public:
os.put(REDUCE);
}
+ inline void writePointer(unsigned long long addr) {
+ os.put(GLOBAL);
+ os << "unpickle\nPointer\n";
+ os.put(BINPUT);
+ os.put(1);
+ writeInt(addr);
+ os.put(TUPLE1);
+ os.put(REDUCE);
+ }
+
protected:
inline void putInt16(uint16_t i) {
os.put( i & 0xff);