rapidjson GetInt() assert
原创
©著作权归作者所有:来自51CTO博客作者比特空间的原创作品,请联系作者获取转载授权,否则将追究法律责任
调用栈
(gdb) bt
#0 0x00007fcefc8fb1f7 in raise () from /lib64/libc.so.6
#1 0x00007fcefc8fc8e8 in abort () from /lib64/libc.so.6
#2 0x00007fcefc8f4266 in __assert_fail_base () from /lib64/libc.so.6
#3 0x00007fcefc8f4312 in __assert_fail () from /lib64/libc.so.6
#4 0x00000000004296fd in rapidjson::GenericValue<rapidjson::UTF8, rapidjson::MemoryPoolAllocatorrapidjson::CrtAllocator >::GetInt (this=, this=) at ../include/rapidjson/document.h:1448
#5 0x000000000042a99a in GetInt (this=, this=) at ../include/rapidjson/document.h:1473
代码
if(obj.HasMember("IsPE")){
const Value & obj_pe = obj["IsPE"];
if(obj_pe.IsNumber()){
if(obj_pe.GetInt() == 1){
}
}
}
为什么if(obj_pe.GetInt() == 1), obj_pe.GetInt()报assert()?