From 34cb5fb6b40c6c027d5efa63bcac059f37b8d0f7 Mon Sep 17 00:00:00 2001 From: An-Cheng Huang Date: Tue, 17 May 2011 11:51:01 -0700 Subject: add var ref "bug" to maintain backward compatibility. --- src/cstore/cstore-varref.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/cstore/cstore-varref.cpp') diff --git a/src/cstore/cstore-varref.cpp b/src/cstore/cstore-varref.cpp index efe1b04..46dba23 100644 --- a/src/cstore/cstore-varref.cpp +++ b/src/cstore/cstore-varref.cpp @@ -109,7 +109,13 @@ Cstore::VarRef::process_ref(const Cpath& ref_comps, return; } if (def->isTypeless()) { - // no value for typeless node + /* no value for typeless node, so this should be invalid ref + * according to the spec. + * XXX however, the original implementation erroneously treats + * this as valid ref and returns the node "name" as the "value". + * for backward compatibility, keep the same behavior. + */ + process_ref(rcomps, pcomps, ERROR_TYPE); return; } if (pcomps.size() == _orig_path_comps.size()) { -- cgit v1.2.3