Skip to content

Commit

Permalink
fix empty parameters list issue (#821)
Browse files Browse the repository at this point in the history
* Fix empty parameters list issue
  • Loading branch information
viglia authored Nov 17, 2023
1 parent 954e533 commit 1b82961
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 26 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

**Fixes**

- Fix empty parameters list issue ([#821](https://github.com/getsentry/symbolic/pull/821))

## 12.6.0

### Various fixes & improvements
Expand Down
42 changes: 21 additions & 21 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions py/symbolic/proguard.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from __future__ import annotations
from typing import Tuple
from typing import Optional, Tuple

import uuid as uuid_mod

Expand Down Expand Up @@ -81,15 +81,20 @@ def remap_method(self, klass: str, method: str) -> Tuple[str, str] | None:
return output if len(output[0]) > 0 and len(output[1]) > 0 else None

def remap_frame(
self, klass: str, method: str, line: int, parameters: str = ""
self,
klass: str,
method: str,
line: int,
parameters: Optional[str] = None,
) -> list[JavaStackFrame]:
"""Remaps the stackframe, given its class, method and line."""
result = self._methodcall(
lib.symbolic_proguardmapper_remap_frame,
encode_str(klass),
encode_str(method),
line,
encode_str(parameters),
encode_str("" if parameters is None else parameters),
parameters is not None,
)

frames = []
Expand Down
3 changes: 2 additions & 1 deletion symbolic-cabi/include/symbolic.h
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,8 @@ struct SymbolicProguardRemapResult symbolic_proguardmapper_remap_frame(const str
const struct SymbolicStr *class_,
const struct SymbolicStr *method,
uintptr_t line,
const struct SymbolicStr *parameters);
const struct SymbolicStr *parameters,
bool use_parameters);

/**
* Remaps a class name.
Expand Down
3 changes: 2 additions & 1 deletion symbolic-cabi/src/proguard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,10 @@ ffi_fn! {
method: *const SymbolicStr,
line: usize,
parameters: *const SymbolicStr,
use_parameters: bool,
) -> Result<SymbolicProguardRemapResult> {
let mapper = &SymbolicProguardMapper::as_rust(mapper).inner.get().mapper;
let frame = if (*parameters).len > 0 {
let frame = if use_parameters {
StackFrame::with_parameters((*class).as_str(), (*method).as_str(), (*parameters).as_str())
} else {
StackFrame::new((*class).as_str(), (*method).as_str(), line)
Expand Down

0 comments on commit 1b82961

Please sign in to comment.