summaryrefslogtreecommitdiff
path: root/src/macro_rules
diff options
context:
space:
mode:
authorJohn Hodge (bugs) <tpg@mutabah.net>2017-06-04 21:23:03 +0800
committerJohn Hodge (bugs) <tpg@mutabah.net>2017-06-04 21:23:03 +0800
commit0b9fd0014c8f32ecf299dae2ad1811dfb484af46 (patch)
tree609eff961f07d7562a2b5a1ffb4a43905f5e98fb /src/macro_rules
parent7a267995c7cfd6b68849079dc4ecae4ebe74e6fa (diff)
downloadmrust-0b9fd0014c8f32ecf299dae2ad1811dfb484af46.tar.gz
All - Compile and run fixes in MSVC
Diffstat (limited to 'src/macro_rules')
-rw-r--r--src/macro_rules/eval.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/macro_rules/eval.cpp b/src/macro_rules/eval.cpp
index 11ec74f2..18ef563e 100644
--- a/src/macro_rules/eval.cpp
+++ b/src/macro_rules/eval.cpp
@@ -564,7 +564,7 @@ public:
const MacroExpansionEnt* next_ent();
const ::std::vector<unsigned int> iterations() const { return m_iterations; }
- unsigned int top_pos() const { return m_offsets[0].read_pos; }
+ unsigned int top_pos() const { if(m_offsets.empty()) return 0; return m_offsets[0].read_pos; }
private:
const MacroExpansionEnt& getCurLayerEnt() const;