-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix suspicious code fragments #112384
Fix suspicious code fragments #112384
Conversation
Contributes to dotnet#112344
@@ -66,7 +66,7 @@ public static void SetAsIConvertible(this ref ComVariant variant, IConvertible v | |||
case TypeCode.Int32: variant = ComVariant.Create(value.ToInt32(ci)); break; | |||
case TypeCode.UInt32: variant = ComVariant.Create(value.ToUInt32(ci)); break; | |||
case TypeCode.Int64: variant = ComVariant.Create(value.ToInt64(ci)); break; | |||
case TypeCode.UInt64: variant = ComVariant.Create(value.ToInt64(ci)); break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may be a real bug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a long-standing bug from at least .NET 6, likely .NET Framework (as it's in the DLR version this code was initially ported from as well):
Line 307 in f1dd571
case TypeCode.UInt64: AsI8 = value.ToInt64(ci); break; |
I think we can fix this going forward, but as this does change the variant type I'd be concerned of breaking consumers if we were to backport this fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I do not think this is something that we want to backport.
@@ -734,7 +734,7 @@ private static bool MatchesTheFilter(MethodBuilderImpl method, BindingFlags meth | |||
|
|||
if (argType.IsArray != paramType.IsArray || | |||
argType.IsByRef != paramType.IsByRef || | |||
argType.IsPointer != argType.IsPointer) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a real corner case bug, but I do not think it is worth it to add a test case that hits it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -161,9 +161,6 @@ static public StackValue CreateFromType(TypeDesc type) | |||
|
|||
public override bool Equals(object obj) | |||
{ | |||
if (Object.ReferenceEquals(this, obj)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Always false
@@ -577,9 +577,6 @@ protected override void OutputMemberScopeModifier(MemberAttributes attributes) | |||
case MemberAttributes.Override: | |||
Output.Write("Overrides "); | |||
break; | |||
case MemberAttributes.Private: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unreachable code. Legacy components - keeping the existing behavior.
@@ -3023,22 +3023,19 @@ private void ImplReadData(BinXmlToken tokenType) | |||
|
|||
private void ImplReadElement() | |||
{ | |||
if (3 != _docState || 9 != _docState) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Always true.
Tagging subscribers to this area: @dotnet/interop-contrib |
src/libraries/System.Reflection.Emit/src/System/Reflection/Emit/TypeBuilderImpl.cs
Outdated
Show resolved
Hide resolved
…t/TypeBuilderImpl.cs
/ba-g unrelated timeouts due to overloaded queues |
* main: [Android] Run CoreCLR functional tests on Android (dotnet#112283) [LoongArch64] Fix some assertion failures for Debug ILC building Debug NativeAOT testcases. (dotnet#112229) Fix suspicious code fragments (dotnet#112384) `__ComObject` doesn't support dynamic interface map (dotnet#112375) Native DLLs: only load imported DLLs from System32 (dotnet#112359) [main] Update dependencies from dotnet/roslyn (dotnet#112314) Update SVE instructions that writes to GC regs (dotnet#112389) Bring up android+coreclr windows build. (dotnet#112256) Never use heap for return buffers (dotnet#112060) Wait to complete the test before releasing the agile reference. (dotnet#112387) Prevent returning disposed HTTP/1.1 connections to the pool (dotnet#112383) Fingerprint dotnet.js if writing import map to html is enabled (dotnet#112407) Remove duplicate definition of CORECLR_HOSTING_API_LINKAGE (dotnet#112096) Update the exception message to reflect current behavior. (dotnet#112355) Use enum for frametype not v table (dotnet#112166) Enable AltJits build for LoongArch64 and RiscV64 (dotnet#110282) Guard members of MonoType union & fix related bugs (dotnet#111645) Add optional hooks for debugging OpenSSL memory allocations (dotnet#111539) JIT: Optimize struct parameter register accesses in the backend (dotnet#110819) NativeAOT: Cover more opcodes in type preinitializer (dotnet#112073)
Contributes to #112344