diff --git a/Iced/Intel/Encoder.cs b/Iced/Intel/Encoder.cs
index 9e8fdd766..7380d0ac1 100644
--- a/Iced/Intel/Encoder.cs
+++ b/Iced/Intel/Encoder.cs
@@ -212,7 +212,7 @@ namespace Iced.Intel {
///
public uint Encode(ref Instruction instruction, ulong rip) {
if (!TryEncode(ref instruction, rip, out uint result, out var errorMessage))
- throw new EncoderException(errorMessage, ref instruction);
+ throw new EncoderException(errorMessage, instruction);
return result;
}
diff --git a/Iced/Intel/EncoderException.cs b/Iced/Intel/EncoderException.cs
index 0a4368e31..a86ff71bd 100644
--- a/Iced/Intel/EncoderException.cs
+++ b/Iced/Intel/EncoderException.cs
@@ -37,7 +37,7 @@ namespace Iced.Intel {
///
/// Exception message
/// Instruction
- public EncoderException(string message, ref Instruction instruction) : base(message) => Instruction = instruction;
+ public EncoderException(string message, in Instruction instruction) : base(message) => Instruction = instruction;
///
/// Constructor