两个错位的名称分解为相同的功能签名 [英] Two mangled names demangling to the same function signature

查看:146
本文介绍了两个错位的名称分解为相同的功能签名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Spidermonkey库,它为函数JS_DefineProperty导出了以下错误的符号:

I have a spidermonkey library that exports the following mangled symbol fora function JS_DefineProperty:

_Z17JS_DefinePropertyP9JSContextP8JSObjectPKcN2JS5ValueEPFiS0_NS5_6HandleIS2_EENS7_I4jsidEENS5_13MutableHandleIS6_EEEPFiS0_S8_SA_iSC_Ej

当我尝试编译使用此功能的文件时,外部引用被编译为:

When I try to compile a file that uses this function, the external reference is compiled as:

_Z17JS_DefinePropertyP9JSContextP8JSObjectPKcN2JS5ValueEPFiS0_NS5_6HandleIS2_EENS7_IlEENS5_13MutableHandleIS6_EEEPFiS0_S8_S9_iSB_Ej

两者的名称末尾略有不同.我都经历了一个名称分解器,它们都具有相同的签名:

The end of the name is slightly different between the two. I ran both through a name demangler and they both come out to the same signature:

JS_DefineProperty(JSContext*, JSObject*, char const*, JS::Value, int (*)(JSContext*, JS::Handle, JS::Handle, JS::MutableHandle), int (*)(JSContext*, JS::Handle, JS::Handle, int, JS::MutableHandle), unsigned int)

所以我对其中的区别有些困惑.我相信这两个版本都是使用g++ 4.7编译的. 任何人都可以解码名称中的其他差异,以便我进一步调查吗?

So I'm a little stumped as to what the difference is. I believe both versions were compiled using g++ 4.7. Can anyone decode the extra difference in the name, so I can investigate further?

推荐答案

实际上两者之间是有区别的.

There is in fact a difference between the two.

_Z17JS_DefinePropertyP9JSContextP8JSObjectPKcN2JS5ValueEPFiS0_NS5_6HandleIS2_EENS7_I4jsidEENS5_13MutableHandleIS6_EEEPFiS0_S8_SA_iSC_Ej分解为:

JS_DefineProperty(JSContext*, JSObject*, char const*, JS::Value, int (*)(JSContext*, JS::Handle<JSObject*>, JS::Handle<jsid>, JS::MutableHandle<JS::Value>), int (*)(JSContext*, JS::Handle<JSObject*>, JS::Handle<jsid>, int, JS::MutableHandle<JS::Value>), unsigned int)

_Z17JS_DefinePropertyP9JSContextP8JSObjectPKcN2JS5ValueEPFiS0_NS5_6HandleIS2_EENS7_IlEENS5_13MutableHandleIS6_EEEPFiS0_S8_S9_iSB_Ej分解为:

JS_DefineProperty(JSContext*, JSObject*, char const*, JS::Value, int (*)(JSContext*, JS::Handle<JSObject*>, JS::Handle<long>, JS::MutableHandle<JS::Value>), int (*)(JSContext*, JS::Handle<JSObject*>, JS::Handle<long>, int, JS::MutableHandle<JS::Value>), unsigned int)

前者使用JS::Handle<jsid>的情况下,后者使用JS::Handle<long>.

Where the former is using JS::Handle<jsid>, the latter is using JS::Handle<long>.

这篇关于两个错位的名称分解为相同的功能签名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆