惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

I
InfoQ
F
Full Disclosure
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
T
Threatpost
AWS News Blog
AWS News Blog
The GitHub Blog
The GitHub Blog
G
GRAHAM CLULEY
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
P
Palo Alto Networks Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
Latest news
Latest news
S
SegmentFault 最新的问题
C
Cisco Blogs
T
Tenable Blog
爱范儿
爱范儿
H
Hackread – Cybersecurity News, Data Breaches, AI and More
S
Securelist
S
Schneier on Security
博客园 - 三生石上(FineUI控件)
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Microsoft Azure Blog
Microsoft Azure Blog
C
CERT Recently Published Vulnerability Notes
NISL@THU
NISL@THU
T
Threat Research - Cisco Blogs
IT之家
IT之家
博客园_首页
C
Cyber Attacks, Cyber Crime and Cyber Security
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
K
Kaspersky official blog
aimingoo的专栏
aimingoo的专栏
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
P
Privacy International News Feed
腾讯CDC
A
About on SuperTechFans
Y
Y Combinator Blog
月光博客
月光博客
C
Check Point Blog
Last Week in AI
Last Week in AI
Know Your Adversary
Know Your Adversary
Hugging Face - Blog
Hugging Face - Blog
U
Unit 42
WordPress大学
WordPress大学
T
The Exploit Database - CXSecurity.com
H
Hacker News: Front Page
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
V
Vulnerabilities – Threatpost
Cyberwarzone
Cyberwarzone
L
LINUX DO - 热门话题
MongoDB | Blog
MongoDB | Blog
T
Troy Hunt's Blog

博客园 - Zhenway

Azure SignalR支持replication啦 Azure SignalR总览 定制json序列化 今天折腾这么一个正则 docfx组件介绍--YamlSerialization docfx daylybuild docfx开源啦 docfx组件介绍--MarkdownLite docfx预热中 合并批量请求 一个简单的Linq to TreeNode 在finally中调用一个需要await的方法 当泛型方法推断,扩展方法遇到泛型类型in/out时。。。 4.5你太黑了,不带这么玩TypeForwardedTo的 一个非常简单的反射加速方案 加载时预防并发执行 又发现一个msdn的坑 又发现个.net framework的坑 sql server死锁神器
踩到一个Emit的坑,留个纪念
Zhenway · 2013-11-13 · via 博客园 - Zhenway

重现代码:

var dmFoo = new DynamicMethod("Foo", typeof(void), Type.EmptyTypes);
var ilFoo = dmFoo.GetILGenerator();
//...
var label = ilFoo.DefineLabel();
//...
var dmBar = new DynamicMethod("Bar", typeof(void), Type.EmptyTypes);
var ilBar = dmBar.GetILGenerator();
//...
ilBar.MarkLabel(label);

报错信息为:

...NullReferenceException...
at System.Reflection.Emit.ILGenerator.MarkLabel(Label loc)
at ...(your code)

很明显代码中把ilFoo的Label试图放到ilBar里去,这时显然应该抛出一个ArgumentException,而Framework却傻乎乎的抛出了个NullReferenceException,害得我白到网上找了两个小时,却没发现什么类似的报错,最后才发现其实是一个参数弄错了