* statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
if it's a class type and not a struct. Fixes #31815.
svn path=/trunk/mcs/; revision=8037
+2002-10-06 Martin Baulig <martin@gnome.org>
+
+ * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
+ if it's a class type and not a struct. Fixes #31815.
+
2002-10-06 Martin Baulig <martin@gnome.org>
* statement.cs: Reworked the flow analysis code a bit to make it
if (index == 0)
return true;
- int field_idx = struct_params [number] [field_name];
+ MyStructInfo info = (MyStructInfo) struct_params [number];
+ if (info == null)
+ return true;
+
+ int field_idx = info [field_name];
return CurrentUsageVector [index + field_idx];
}
if (index == 0)
return;
- int field_idx = struct_params [number] [field_name];
+ MyStructInfo info = (MyStructInfo) struct_params [number];
+ if (info == null)
+ return;
+
+ int field_idx = info [field_name];
if (!CurrentUsageVector.AlwaysBreaks)
CurrentUsageVector [index + field_idx] = true;