MCPcopy
hub / github.com/cilium/ebpf / SetSource

Method SetSource

asm/opcode.go:225–230  ·  view source on GitHub ↗

SetSource sets the source on jump and ALU operations. Returns InvalidOpCode if op is of the wrong class.

(source Source)

Source from the content-addressed store, hash-verified

223//
224// Returns InvalidOpCode if op is of the wrong class.
225func (op OpCode) SetSource(source Source) OpCode {
226 if !op.Class().isJumpOrALU() || !valid(OpCode(source), sourceMask) {
227 return InvalidOpCode
228 }
229 return (op & ^sourceMask) | OpCode(source)
230}
231
232// SetALUOp sets the ALUOp on ALU operations.
233//

Callers 5

HostToFunction · 0.80
OpMethod · 0.80
Op32Method · 0.80
OpMethod · 0.80
opCodeMethod · 0.80

Calls 4

ClassMethod · 0.95
validFunction · 0.85
OpCodeTypeAlias · 0.85
isJumpOrALUMethod · 0.80

Tested by

no test coverage detected