diff options
author | John Hodge <tpg@mutabah.net> | 2016-08-19 11:23:12 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-08-19 11:23:12 +0800 |
commit | 6516fda5b3a623bf6fd54ef36f99a336fc7f268d (patch) | |
tree | 3db571ec694818c0abac4c83321c1c3e9f00068f | |
parent | b7b634f517967da41befff67d579c5a1afa8d016 (diff) | |
download | mrust-6516fda5b3a623bf6fd54ef36f99a336fc7f268d.tar.gz |
Fix little bugs in recent spate of fixes
-rw-r--r-- | src/hir_typeck/expr_cs.cpp | 2 | ||||
-rw-r--r-- | src/parse/lex.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/hir_typeck/expr_cs.cpp b/src/hir_typeck/expr_cs.cpp index 159209fb..cdfff8b5 100644 --- a/src/hir_typeck/expr_cs.cpp +++ b/src/hir_typeck/expr_cs.cpp @@ -2719,7 +2719,7 @@ void Context::add_binding(const Span& sp, ::HIR::Pattern& pat, const ::HIR::Type // NOTE: Must be Generic for the above to have passed auto& gp = te.path.m_data.as_Generic(); - ASSERT_BUG(sp, e.sub_patterns.size() != tup_var.size(), + ASSERT_BUG(sp, e.sub_patterns.size() == tup_var.size(), "Enum pattern with an incorrect number of fields - " << e.path << " - expected " << tup_var.size() << ", got " << e.sub_patterns.size() ); diff --git a/src/parse/lex.cpp b/src/parse/lex.cpp index 42e36574..6e274adc 100644 --- a/src/parse/lex.cpp +++ b/src/parse/lex.cpp @@ -1202,14 +1202,14 @@ bool Codepoint::isxdigit() const { s += (char)(0x80 | ((cp.v >> 6) & 0x3F)); s += (char)(0x80 | ((cp.v >> 0) & 0x3F)); } - else if( cp.v <= (0x07+1)<<(2*6) ) { + else if( cp.v <= (0x07+1)<<(3*6) ) { s += (char)(0xF0 | ((cp.v >> 18) & 0x07)); s += (char)(0x80 | ((cp.v >> 12) & 0x3F)); s += (char)(0x80 | ((cp.v >> 6) & 0x3F)); s += (char)(0x80 | ((cp.v >> 0) & 0x3F)); } else { - throw ::std::runtime_error("BUGCHECK: Bad unicode codepoint encountered"); + throw ::std::runtime_error( FMT("BUGCHECK: Bad unicode codepoint encountered - " << ::std::hex << cp.v) ); } return s; } |